create general emcal task lib
[u/mrichter/AliRoot.git] / PWG / EMCAL / macros / ConfigEmcalTenderSupply.C
1 // $Id$
2
3 AliEMCALTenderSupply* ConfigEmcalTenderSupply(
4   Bool_t timeCut       = kTRUE,
5   Bool_t distBC        = kTRUE, 
6   Bool_t recalibClus   = kTRUE, 
7   Bool_t recalcClusPos = kTRUE, 
8   Bool_t nonLinearCorr = kTRUE, 
9   Bool_t remExotic     = kTRUE,
10   Bool_t fidRegion     = kFALSE,
11   Bool_t calibEnergy   = kTRUE,
12   Bool_t calibTime     = kTRUE)
13 {
14   AliEMCALTenderSupply *EMCALSupply = new AliEMCALTenderSupply("EMCALtender");  
15   EMCALSupply->SetDebugLevel(2);
16
17   AliEMCALRecParam *params = new AliEMCALRecParam();
18   params->SetClusteringThreshold(0.1); // 100 MeV
19   params->SetMinECut(0.05);            //50 MeV  
20   params->SetW0(4.5);
21   if (timeCut) {
22     params->SetTimeCut(1e6); //Open this cut for AODs
23     params->SetTimeMin(-1);  //Open this cut for AODs
24     params->SetTimeMax(1e6); //Open this cut for AODs
25   }
26   EMCALSupply->SetRecParam(params);
27
28   if (distBC)
29     EMCALSupply->SwitchOnRecalDistBadChannel();
30   else
31     EMCALSupply->SwitchOffRecalDistBadChannel();
32   
33   if (recalibClus) {
34     EMCALSupply->SwitchOnReCalibrateCluster();
35     EMCALSupply->SwitchOnUpdateCell();
36   }
37   else {
38     EMCALSupply->SwitchOffReCalibrateCluster();
39     EMCALSupply->SwitchOffUpdateCell();
40   }
41   
42   if (recalcClusPos)
43     EMCALSupply->SwitchOnRecalculateClusPos();
44   else
45     EMCALSupply->SwitchOffRecalculateClusPos();
46   
47   if (nonLinearCorr) {
48     EMCALSupply->SetNonLinearityFunction(AliEMCALTenderSupply::kBeamTestCorrected);
49     EMCALSupply->SwitchOnNonLinearityCorrection();
50   }
51   else {
52     EMCALSupply->SwitchOffNonLinearityCorrection();
53   }
54   
55   if (remExotic) 
56       EMCALSupply->SwitchOnClusterExoticChannelCheck();
57   else
58     EMCALSupply->SwitchOffClusterExoticChannelCheck();
59   
60   if (fidRegion)
61     EMCALSupply->SwitchOnCellFiducialRegion();
62   else
63     EMCALSupply->SwitchOffCellFiducialRegion();
64
65   if (calibTime)
66     EMCALSupply->SwitchOnCalibrateTime();
67   else
68     EMCALSupply->SwitchOffCalibrateTime();
69
70   if (calibEnergy)
71     EMCALSupply->SwitchOnCalibrateEnergy();
72   else
73     EMCALSupply->SwitchOffCalibrateEnergy();
74
75   EMCALSupply->SetMass(0.139);
76   EMCALSupply->SwitchOnCutEtaPhiSeparate();
77   EMCALSupply->SetEtaCut(0.025);
78   EMCALSupply->SetPhiCut(0.05);
79   
80   return EMCALSupply;
81 }