]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/totEt/macros/AddTaskEMCALTenderForEtAnalysis.C
Merge branch 'feature-movesplit'
[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 , Bool_t withNonlinearity = kTRUE , Bool_t withReclusterizing = kFALSE, Int_t trackmatchcuts==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.015);
68 //   EMCALSupply->SetPhiCut(0.03);
69   if(trackmatchcuts==0){//default
70     EMCALSupply->SetEtaCut(0.025);
71     EMCALSupply->SetPhiCut(0.05);
72   }
73   if(trackmatchcuts==1){//tighter
74     EMCALSupply->SetEtaCut(0.015);
75     EMCALSupply->SetPhiCut(0.03);
76   }
77   if(trackmatchcuts==2){//looser
78     EMCALSupply->SetEtaCut(0.035);
79     EMCALSupply->SetPhiCut(0.07);
80   }
81
82   // switches ---------------------------------------------------------------
83   EMCALSupply->SwitchOnBadCellRemove();
84   EMCALSupply->SwitchOnExoticCellRemove();
85   EMCALSupply->SwitchOnCalibrateEnergy();
86   EMCALSupply->SwitchOnCalibrateTime();
87   EMCALSupply->SwitchOnUpdateCell();
88   if(withReclusterizing) EMCALSupply->SwitchOnReclustering();
89   EMCALSupply->SwitchOnClusterBadChannelCheck();
90   EMCALSupply->SwitchOnClusterExoticChannelCheck();
91   EMCALSupply->SwitchOnCellFiducialRegion();
92   EMCALSupply->SwitchOnReCalibrateCluster();
93   EMCALSupply->SwitchOnRecalculateClusPos();
94   EMCALSupply->SwitchOnRecalShowerShape();
95   EMCALSupply->SwitchOnRecalDistBadChannel();
96  if(withNonlinearity) EMCALSupply->SwitchOnNonLinearityCorrection();
97 else{cout<<"WARNING:  TURNING OFF NONLINEARITY"<<endl;}
98   EMCALSupply->SwitchOnTrackMatch();
99   
100
101   ana->AddSupply(EMCALSupply);
102   // Create ONLY the output containers for the data produced by the task.
103   // Get and connect other common input/output containers via the manager as below
104   //==============================================================================
105 //  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("histosEmcalTender", TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s", AliAnalysisManager::GetCommonFileName()));
106   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("emcal_tender_event", AliESDEvent::Class(),
107                            AliAnalysisManager::kExchangeContainer,"emcal_tender");
108   
109   mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());
110   mgr->ConnectOutput (ana, 1, coutput1 );
111    
112   return ana;
113 }
114