]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/totEt/macros/AddTaskEMCALTenderForEtAnalysis.C
Switching off reclustering in tender supply for ET analysis
[u/mrichter/AliRoot.git] / PWGLF / totEt / macros / AddTaskEMCALTenderForEtAnalysis.C
1 // EMCal tender task adder
2 // Author: Jiri Kral
3
4 AliTender *AddTaskEMCALTender(const char *geoname="EMCAL_COMPLETEV1", AliEMCALRecParam *pars = 0 )
5 {
6   // Parameters: geoname = "EMCAL_FIRSTYEARV1" or "EMCAL_COMPLETEV1" or ""
7
8   // Get the pointer to the existing analysis manager via the static access method.
9   //==============================================================================
10   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
11   if (!mgr) {
12     ::Error("AddTaskEMCALTender", "No analysis manager to connect to.");
13     return NULL;
14   }  
15   
16   // Create the task and configure it.
17   //===========================================================================
18   AliTender* ana = new  AliTender("TenderTask");
19   
20   mgr->AddTask(ana);
21
22   // Adding EMCAL supply
23   AliEMCALTenderSupply *EMCALSupply=new AliEMCALTenderSupply("EMCALtender");  
24
25   EMCALSupply->SetEMCALGeometryName(geoname);  
26
27   // prepare the reco params ------------------------------------------------
28         if( pars == 0 ){
29                 // you can write your reco params here to avoid loading them automatically
30                 // from OCDB during execution time
31                 AliEMCALRecParam *params = new AliEMCALRecParam();
32                 // reclustering parameters
33                 // use v1 for pp and v2 for PbPb
34                 params->SetClusterizerFlag(AliEMCALRecParam::kClusterizerv2);
35                 params->SetClusteringThreshold(0.1); // 100 MeV
36                 params->SetMinECut(0.05); //50 MeV  
37                 params->SetW0(4.5);
38                 // you may want to enable the timing cut
39                 params->SetTimeCut(1e6);// s
40                 params->SetTimeMin(-1);
41                 params->SetTimeMax(1e6);//s
42
43                 EMCALSupply->SetRecParam(params);
44         }
45         else{
46                 cout << "------- TENDER is using supplied reco params -------" << endl;
47                 pars->Print( "reco" );
48                 cout << "----------------------------------------------------" << endl;
49                 EMCALSupply->SetRecParam(pars);
50         }
51
52   // prepare tender parameters ----------------------------------------------
53   EMCALSupply->SetDebugLevel( 0 );
54
55   // fiducial cut
56   EMCALSupply->SetNumberOfCellsFromEMCALBorder( 1 );
57
58   // nonlinearity
59   EMCALSupply->SetNonLinearityFunction( AliEMCALTenderSupply::kBeamTestCorrected );
60
61   // track matching parameters
62   //EMCALSupply->SetMass(0.139);
63   //EMCALSupply->SetStep(5);
64   EMCALSupply->SwitchOnCutEtaPhiSum(); 
65   EMCALSupply->SetRCut(0.025);
66   //EMCALSupply->SwitchOnCutEtaPhiSeparate();
67   EMCALSupply->SetEtaCut(0.025);
68   EMCALSupply->SetPhiCut(0.05);
69
70   // switches ---------------------------------------------------------------
71   EMCALSupply->SwitchOnBadCellRemove();
72   EMCALSupply->SwitchOnExoticCellRemove();
73   EMCALSupply->SwitchOnCalibrateEnergy();
74   EMCALSupply->SwitchOnCalibrateTime();
75   EMCALSupply->SwitchOnUpdateCell();
76   //EMCALSupply->SwitchOnReclustering();
77   EMCALSupply->SwitchOnClusterBadChannelCheck();
78   EMCALSupply->SwitchOnClusterExoticChannelCheck();
79   EMCALSupply->SwitchOnCellFiducialRegion();
80   EMCALSupply->SwitchOnReCalibrateCluster();
81   EMCALSupply->SwitchOnRecalculateClusPos();
82   EMCALSupply->SwitchOnRecalShowerShape();
83   EMCALSupply->SwitchOnRecalDistBadChannel();
84   EMCALSupply->SwitchOnNonLinearityCorrection();
85   EMCALSupply->SwitchOnTrackMatch();
86   
87
88   ana->AddSupply(EMCALSupply);
89   // Create ONLY the output containers for the data produced by the task.
90   // Get and connect other common input/output containers via the manager as below
91   //==============================================================================
92 //  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("histosEmcalTender", TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s", AliAnalysisManager::GetCommonFileName()));
93   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("emcal_tender_event", AliESDEvent::Class(),
94                            AliAnalysisManager::kExchangeContainer,"emcal_tender");
95   
96   mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());
97   mgr->ConnectOutput (ana, 1, coutput1 );
98    
99   return ana;
100 }
101