create general emcal task lib
[u/mrichter/AliRoot.git] / PWG / EMCAL / macros / ConfigEmcalTenderSupply.C
CommitLineData
a55e4f1d 1// $Id$
2
3AliEMCALTenderSupply* ConfigEmcalTenderSupply(
a55e4f1d 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,
ab11721c 9 Bool_t remExotic = kTRUE,
10 Bool_t fidRegion = kFALSE,
e6e03c89 11 Bool_t calibEnergy = kTRUE,
ab11721c 12 Bool_t calibTime = kTRUE)
a55e4f1d 13{
14 AliEMCALTenderSupply *EMCALSupply = new AliEMCALTenderSupply("EMCALtender");
15 EMCALSupply->SetDebugLevel(2);
16
17 AliEMCALRecParam *params = new AliEMCALRecParam();
18 params->SetClusteringThreshold(0.1); // 100 MeV
e5f84b1e 19 params->SetMinECut(0.05); //50 MeV
a55e4f1d 20 params->SetW0(4.5);
21 if (timeCut) {
e5f84b1e 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
a55e4f1d 25 }
26 EMCALSupply->SetRecParam(params);
27
a55e4f1d 28 if (distBC)
29 EMCALSupply->SwitchOnRecalDistBadChannel();
30 else
31 EMCALSupply->SwitchOffRecalDistBadChannel();
32
e6e03c89 33 if (recalibClus) {
a55e4f1d 34 EMCALSupply->SwitchOnReCalibrateCluster();
e6e03c89 35 EMCALSupply->SwitchOnUpdateCell();
36 }
37 else {
a55e4f1d 38 EMCALSupply->SwitchOffReCalibrateCluster();
e6e03c89 39 EMCALSupply->SwitchOffUpdateCell();
40 }
a55e4f1d 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
ab11721c 65 if (calibTime)
66 EMCALSupply->SwitchOnCalibrateTime();
67 else
68 EMCALSupply->SwitchOffCalibrateTime();
69
e6e03c89 70 if (calibEnergy)
71 EMCALSupply->SwitchOnCalibrateEnergy();
72 else
73 EMCALSupply->SwitchOffCalibrateEnergy();
74
a55e4f1d 75 EMCALSupply->SetMass(0.139);
a55e4f1d 76 EMCALSupply->SwitchOnCutEtaPhiSeparate();
77 EMCALSupply->SetEtaCut(0.025);
78 EMCALSupply->SetPhiCut(0.05);
79
80 return EMCALSupply;
81}