]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/ana/deadChannelMap/deadChannelMap.cxx
Added various files used for analysis of HLT output data.
[u/mrichter/AliRoot.git] / HLT / PHOS / ana / deadChannelMap / deadChannelMap.cxx
1
2 #include "TTree.h"
3 #include "TChain.h"
4 #include "TClonesArray.h"
5 #include "AliHLTPHOSDebugRawDigit.h"
6 #include <iostream>
7 #include "TH2D.h"
8 #include "TFile.h"
9
10 using namespace std;
11
12 Int_t deadChannelMap(const char*);
13
14 int main(int argc, const char** argv)
15 {
16   deadChannelMap(argv[1]);
17   return 0;
18 }
19
20 Int_t deadChannelMap(const char* runNb)
21 {
22   char filepath [50];
23   char outfile [50];
24   
25   TChain *tree= new TChain("digitTree");
26
27   sprintf(filepath, "/tmp/phoshlt/analysis/data/run%s/*", runNb);
28   sprintf(outfile, "/home/phoshlt/analysis/output/run%s/deadMap.root", runNb);
29   tree->Add(filepath);
30  
31   TClonesArray *digArray = new TClonesArray("AliHLTPHOSDebugRawDigit" , 100);
32   //tree->SetBranchAddress("digits", &digArray);
33   tree->SetBranchAddress("DebugRawDigit", &digArray);
34   TH2D *deadMap = new TH2D("deadMap", "Dead Channel Map", 64, 0, 63, 56, 0, 55);
35   AliHLTPHOSDebugRawDigit *digit = 0;
36
37   cout << endl << "Chain with " << tree->GetEntries() << " events...\n";
38   for(int k = 0; k < tree->GetEntries(); k++)
39     {
40       tree->GetEntry(k);
41       //  cout << "     Event with " << digArray->GetEntriesFast() << " digits\n";
42       for(int j = 0; j < digArray->GetEntriesFast(); j++)
43         {
44           digit = (AliHLTPHOSDebugRawDigit*)digArray->At(j);
45           for(int i = 0; i < 70; i++)
46             {
47               if((digit->GetRawData())[i] > 55)
48                 {
49                   if((digit->GetRawData())[i+1] > 55)
50                     {
51                       if((digit->GetRawData())[i+2] > 55)
52                         {
53                           if((digit->GetRawData())[i+3] > 55)
54                             {
55                               deadMap->SetBinContent(digit->GetX(), digit->GetZ(), 10);
56                               break;
57                             }
58                         }
59                     }
60                 }
61             }
62         }
63     }
64
65   
66   cout << "Printing file...";
67
68
69   TFile *file = new TFile(outfile,"recreate");
70   deadMap->Write();
71   file->Close();
72   delete file;
73   file = 0;
74   cout << "Done!\n";
75
76
77   
78   return 0;
79 }
80   
81