1 //************************************************************************
2 // A macro to read and visualize EMCAL data
4 // - can read hits, digits and clusters information from AliRunLoader:
5 // emcal_data->LoadHits(ht);
6 // emcal_data->LoadDigits(dt);
7 // emcal_data->LoadRecPoints(rt);
8 // - can read hits, digits and clusters information from AliEMCALLoader:
9 // rl->GetEvent(evtNum);
10 // emcal_data->LoadHitsFromEMCALLoader(emcl); // Does not work
11 // emcal_data->LoadDigitsFromEMCALLoader(emcl);
12 // emcal_data->LoadRecPointsFromEMCALLoader(emcl);
13 // - can read hits, digits and clusters information from ESDs
14 // emcal_data->LoadDigitsFromESD();
15 // emcal_data->LoadClustersFromESD();
16 // - will read hits, digits and clusters information from raw
17 // => To be implemented
19 //************************************************************************
20 // Author: Magali Estienne (magali.estienne@cern.ch)
22 //************************************************************************
24 #include <Riostream.h>
28 class AliEveEMCALData;
29 AliEveEMCALData *emcal_data = 0;
31 void emcal_all(const UInt_t evtNum = 0, Bool_t digFile = 0,
32 const UInt_t eventsToProcess = 5, TString dirName = "./",
33 const TString esdTreeName = "esdTree", const char * pattern = ".")
35 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
37 cout<<"Can not instatiate the Run Loader"<<endl;
38 AliESDEvent* esd = AliEveEventManager::AssertESD();
39 AliEMCALLoader *emcl = dynamic_cast<AliEMCALLoader*> (rl->GetDetectorLoader("EMCAL"));
40 Int_t evtID = gAliEveEvent->GetEventId();
41 if(evtID != evtNum) gAliEveEvent->GotoEvent(evtNum);
44 rl->LoadHits("EMCAL");
46 rl->LoadDigits("EMCAL");
48 rl->LoadRecPoints("EMCAL");
50 TTree* ht = rl->GetTreeH("EMCAL",false);
51 TTree* dt = rl->GetTreeD("EMCAL",false);
52 TTree *rt = rl->GetTreeR("EMCAL",false);
54 gGeoManager = gEve->GetDefaultGeometry();
55 TGeoNode* node = gGeoManager->GetTopVolume()->FindNode("XEN1_1");
56 TGeoHMatrix* m = gGeoManager->GetCurrentMatrix();
57 emcal_data = new AliEveEMCALData(rl,node,m);
58 emcal_data->SetESD(esd);
59 // RunLoader information
60 // emcal_data->LoadHits(ht); // Does not work with my aliroot version ?
61 // emcal_data->LoadDigits(dt);
62 // emcal_data->LoadRecPoints(rt);
64 // To be uncommented if use of emcalLoader
66 emcal_data->LoadHitsFromEMCALLoader(emcl);
67 // emcal_data->LoadDigitsFromEMCALLoader(emcl);
68 // emcal_data->LoadRecPointsFromEMCALLoader(emcl);
70 // To be uncommented to read esds
71 emcal_data->LoadDigitsFromESD();
72 emcal_data->LoadRecPointsFromESD();
74 gStyle->SetPalette(1, 0);
76 gEve->DisableRedraw();
78 TEveElementList* l = new TEveElementList("EMCAL");
79 l->SetTitle("Tooltip");
80 l->SetMainColor(Color_t(2));
83 for (Int_t sm=0; sm<12; sm++)
85 cout << "\n Form: " << Form("SM %d", sm) << endl;
86 AliEveEMCALSModule* esm = new AliEveEMCALSModule(sm,Form("SM %d Element \n", sm),"test");
87 // esm->SetSModuleID(sm);
88 esm->SetDataSource(emcal_data);
94 gEve->Redraw3D(kTRUE);