]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/macros/ConfigCaloFilter.C
comment
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / macros / ConfigCaloFilter.C
1 AliAnalysisTaskCaloFilter * ConfigCaloFilter(){
2   
3   AliAnalysisTaskCaloFilter * filter = new AliAnalysisTaskCaloFilter("EMCALFilter");
4   filter->SelectCollisionCandidates(); 
5   filter->SetCaloFilter(AliAnalysisTaskCaloFilter::kBoth); //kPHOS or kBoth
6   filter->SwitchOnClusterCorrection();
7   //filter->SetDebugLevel(10);
8   AliEMCALRecoUtils * reco = filter->GetEMCALRecoUtils();
9   reco->SetParticleType(AliEMCALRecoUtils::kPhoton);
10   reco->SetW0(4.5);
11   
12   reco->SetPositionAlgorithm(AliEMCALRecoUtils::kPosTowerGlobal);
13   
14   TGeoHMatrix *matrix[4];
15   
16   double rotationMatrix[4][9] = {-0.014587, -0.999892, -0.002031, 0.999892, -0.014591,  0.001979, -0.002009, -0.002002,  0.999996,
17     -0.014587,  0.999892,  0.002031, 0.999892,  0.014591, -0.001979, -0.002009,  0.002002, -0.999996,
18     -0.345864, -0.938278, -0.003412, 0.938276, -0.345874,  0.003010, -0.004004, -0.002161,  0.999990,
19     -0.345861,  0.938280,  0.003412, 0.938276,  0.345874, -0.003010, -0.004004,  0.002161, -0.999990};
20   
21   double translationMatrix[4][3] = {0.351659,    447.576446,  176.269742,
22     1.062577,    446.893974, -173.728870,
23     -154.213287, 419.306156,  176.753692,
24     -153.018950, 418.623681, -173.243605};
25   for(int j=0; j<4; j++)
26   {
27     matrix[j] = new TGeoHMatrix();
28     matrix[j]->SetRotation(rotationMatrix[j]);
29     matrix[j]->SetTranslation(translationMatrix[j]);
30     matrix[j]->Print();
31     filter->SetEMCALGeometryMatrixInSM(matrix[j],j);
32   }
33   
34   filter->SwitchOnLoadOwnEMCALGeometryMatrices();
35   
36   reco->SetNonLinearityFunction(AliEMCALRecoUtils::kNoCorrection);
37   
38   //Time dependent corrections    
39   //Recover file from alien  /alice/cern.ch/user/g/gconesab/TimeDepCorrectionDB
40 //  reco->SwitchOnTimeDepCorrection();
41 //  char cmd[200] ;
42 //  sprintf(cmd, ".!tar xvfz CorrectionFiles.tgz") ;
43 //  gROOT->ProcessLine(cmd) ;
44   
45   //Recalibration factors
46   //Recover the file from alien  /alice/cern.ch/user/g/gconesab/RecalDB
47 //  reco->SwitchOnRecalibration();
48 //  TFile * f = new TFile("RecalibrationFactors.root","read");
49 //  TH2F * h0 = (TH2F*)f->Get("EMCALRecalFactors_SM0");
50 //  TH2F * h1 = (TH2F*)f->Get("EMCALRecalFactors_SM1");
51 //  TH2F * h2 = (TH2F*)f->Get("EMCALRecalFactors_SM2");
52 //  TH2F * h3 = (TH2F*)f->Get("EMCALRecalFactors_SM3");
53 //  
54 //  reco->SetEMCALChannelRecalibrationFactors(0,h0);
55 //  reco->SetEMCALChannelRecalibrationFactors(1,h1);
56 //  reco->SetEMCALChannelRecalibrationFactors(2,h2);
57 //  reco->SetEMCALChannelRecalibrationFactors(3,h3);
58 //  
59 //  //Bad channels
60 //  //Recover the file from alien  /alice/cern.ch/user/g/gconesab/BadChannelsDB
61 //  reco->SwitchOnBadChannelsRemoval();
62 //  reco->SwitchOnDistToBadChannelRecalculation();
63 //  TFile * fbad = new TFile("BadChannels.root","read");
64 //  TH2I * hbad0 = (TH2I*)fbad->Get("EMCALBadChannelMap_Mod0");
65 //  TH2I * hbad1 = (TH2I*)fbad->Get("EMCALBadChannelMap_Mod1");
66 //  TH2I * hbad2 = (TH2I*)fbad->Get("EMCALBadChannelMap_Mod2");
67 //  TH2I * hbad3 = (TH2I*)fbad->Get("EMCALBadChannelMap_Mod3");
68 //  reco->SetEMCALChannelStatusMap(0,hbad0);
69 //  reco->SetEMCALChannelStatusMap(1,hbad1);
70 //  reco->SetEMCALChannelStatusMap(2,hbad2);
71 //  reco->SetEMCALChannelStatusMap(3,hbad3);
72   
73   //reco->Print("");
74   filter->PrintInfo();   
75
76   return filter;
77
78 }