]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/macros/AddTaskEMCALTender.C
1b967e31072c82d0286d3c98cf7b13414680e736
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / macros / AddTaskEMCALTender.C
1 AliTender *AddTaskEMCALTender(const char *geoname="EMCAL_COMPLETEV1", const char* datatype="pp")
2 {
3   // Parameters: geoname = "EMCAL_FIRSTYEARV1" or "EMCAL_COMPLETEV1" or ""
4
5   // Get the pointer to the existing analysis manager via the static access method.
6   //==============================================================================
7   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
8   if (!mgr) {
9     ::Error("AddTaskTrgContam", "No analysis manager to connect to.");
10     return NULL;
11   }  
12   
13   // Create the task and configure it.
14   //===========================================================================
15   AliTender* ana = new  AliTender("AliTender");
16
17   ana->SelectCollisionCandidates( AliVEvent::kEMC1 | AliVEvent::kMB | AliVEvent::kEMC7 | AliVEvent::kINT7);
18
19   
20   Bool_t ismc = (mgr->GetMCtruthEventHandler() != NULL);
21
22   
23   mgr->AddTask(ana);
24   // Adding EMCAL supply
25   AliEMCALTenderSupply *EMCALSupply=new AliEMCALTenderSupply("EMCALtender");  
26   EMCALSupply->SetDebugLevel(2);
27
28   AliEMCALRecParam *params = new AliEMCALRecParam();
29   params->SetClusteringThreshold(0.1); // 100 MeV
30   params->SetMinECut(0.05); //50 MeV  
31   params->SetW0(4.5);
32   params->SetTimeCut(1e6);//Open this cut for AODs
33   params->SetTimeMin(-1);//Open this cut for AODs
34   params->SetTimeMax(1e6);//Open this cut for AODs
35   EMCALSupply->SetRecParam(params);
36
37   EMCALSupply->SetEMCALGeometryName(geoname);  
38
39   EMCALSupply->SwitchOffCellFiducialRegion(); //Does NOT remove edge clusters
40   if (!ismc) {
41     if (1){//datatype == "pp") {
42       //::Info("AddTaskEMCALTender", "USING pp data configuration...");
43       //params->SetClusterizerFlag(AliEMCALRecParam::kClusterizerv2); //Std for pbpb
44       EMCALSupply->SwitchOffRecalDistBadChannel();
45       EMCALSupply->SwitchOnReCalibrateCluster();
46       EMCALSupply->SwitchOnRecalculateClusPos();
47       //EMCALSupply->SetNonLinearityFunction(AliEMCALTenderSupply::kBeamTestCorrected);
48       //EMCALSupply->SwitchOnUpdateCell(); // will update cells and reclusterize
49       //EMCALSupply->SwitchOnReclustering(); //SwitchOnReclustering if needed      
50     } else {
51       //::Info("AddTaskEMCALTender", "USING PbPb data configuration...");
52       //params->SetClusterizerFlag(AliEMCALRecParam::kClusterizerv2); //Std for pbpb
53       EMCALSupply->SwitchOnUpdateCell(); // will update cells and reclusterize
54       //EMCALSupply->SwitchOnReclustering(); //SwitchOnReclustering if needed      
55     }
56   } else {
57     ::Info("AddTaskEMCALTender", "USING MC configuration...");
58   }
59   EMCALSupply->SetMass(0.139);
60   //EMCALSupply->SetStep(5);
61   //EMCALSupply->SwitchOnCutEtaPhiSum(); 
62   //EMCALSupply->SetRCut(0.0025);
63
64   EMCALSupply->SwitchOnCutEtaPhiSeparate();
65   EMCALSupply->SetEtaCut(0.025);
66   EMCALSupply->SetPhiCut(0.05);
67
68   ana->AddSupply(EMCALSupply);
69   // Create ONLY the output containers for the data produced by the task.
70   // Get and connect other common input/output containers via the manager as below
71   //==============================================================================
72   AliAnalysisDataContainer *coutput1 = 
73     mgr->CreateContainer("tender_event", 
74                          AliESDEvent::Class(), 
75                          AliAnalysisManager::kExchangeContainer,
76                          "default_tender");
77   mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());
78   mgr->ConnectOutput (ana, 1, coutput1 );
79    
80   return ana;
81 }