1 //_____________________________________________________________________________
2 Int_t AliTRDdisplayDigits3D(Int_t event = 0, Int_t thresh = 4
3 , Bool_t sdigits = kFALSE)
9 // <event> : Event number
10 // <thresh> : Threshold to suppress the noise
11 // <sdigits> : If kTRUE it will display summable digits, normal digits otherwise.
12 // The signal event is displayed in yellow.
15 Char_t *inputFile = "galice.root";
21 TString evfoldname = AliConfig::GetDefaultEventFolderName();
22 AliRunLoader *runLoader = AliRunLoader::GetRunLoader(evfoldname);
24 runLoader = AliRunLoader::Open(inputFile
25 ,AliConfig::GetDefaultEventFolderName()
29 printf("Can not open session for file %s.",inputFile);
33 if (!runLoader->GetAliRun()) {
34 runLoader->LoadgAlice();
36 gAlice = runLoader->GetAliRun();
38 printf("Could not find AliRun object.\n");
42 runLoader->GetEvent(event);
44 AliLoader *loader = runLoader->GetLoader("TRDLoader");
46 printf("Can not get TRD loader from Run Loader");
50 // Get the pointer to the detector object
51 trd = (AliTRDv1*) gAlice->GetDetector("TRD");
53 // Get the pointer to the geometry object
55 geo = trd->GetGeometry();
58 printf("Cannot find the geometry\n");
62 AliCDBManager *cdbManager = AliCDBManager::Instance();
63 cdbManager->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
64 AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
65 calibration->SetRun(0);
67 TCanvas *c1 = new TCanvas("digits","TRD digits display",0,0,700,730);
68 TView *v = new TView(1);
69 v->SetRange(-430,-560,-430,430,560,1710);
76 Int_t markerColorSignal = 2;
77 Int_t markerColorBgnd = 7;
78 Int_t markerColorMerged = 5;
79 Int_t mask = 10000000;
81 // Create the digits manager
82 AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
83 digitsManager->SetSDigits(sdigits);
85 // Read the digits from the file
87 digitsManager->ReadDigits(loader->TreeS());
90 if (!loader->TreeD()) {
94 digitsManager->ReadDigits(loader->TreeD());
97 Int_t totalsignal = 0;
99 Int_t totalmerged = 0;
100 Int_t timeMax = calibration->GetNumberOfTimeBins();
102 // Loop through all detectors
103 for (Int_t idet = 0; idet < geo->Ndet(); idet++) {
105 printf("<AliTRDdisplayDigits3D> Loading detector %d\n",idet);
106 AliTRDdataArrayI *digits = digitsManager->GetDigits(idet);
109 Int_t isec = geo->GetSector(idet);
110 Int_t icha = geo->GetChamber(idet);
111 Int_t ipla = geo->GetPlane(idet);
112 AliTRDpadPlane *padPlane = new AliTRDpadPlane(ipla,icha);
113 Int_t rowMax = padPlane->GetNrows();
114 Int_t colMax = padPlane->GetNcols();
116 Int_t ndigits = digits->GetOverThreshold(thresh);
120 TPolyMarker3D *pmSignal = new TPolyMarker3D(ndigits);
123 for (Int_t time = 0; time < timeMax; time++) {
124 for (Int_t col = 0; col < colMax; col++) {
125 for (Int_t row = 0; row < rowMax; row++) {
127 Int_t amp = digits->GetDataUnchecked(row,col,time);
137 geo->Local2Global(idet,loc,glb);
142 pmSignal->SetPoint(isignal,x,y,z);
152 digits->Compress(1,0);
154 pmSignal->SetMarkerSize(1);
155 pmSignal->SetMarkerColor(markerColorSignal);
156 pmSignal->SetMarkerStyle(1);
165 TGeometry *geoAlice = gAlice->GetGeometry();
166 TNode *main = (TNode *) ((geoAlice->GetListOfNodes())->First());
167 TIter next(main->GetListOfNodes());
169 while ((module = (TNode *) next())) {
171 sprintf(ch,"%s\n",module->GetTitle());
172 if ((ch[0] == 'T') && ((ch[1] == 'R') || (ch[1] == 'P'))) {
173 module->SetVisibility( 3);
176 module->SetVisibility(-1);
180 geoAlice->Draw("same");