6 #include <AliTPCComposedCorrection.h>
7 #include <AliTPCCorrectionLookupTable.h>
9 #include <AliToyMCEventGenerator.h>
12 AliTPCComposedCorrection* GetComposedResidualDistortion(TString fluctuationMap, TString averageMap, Bool_t rescale=kTRUE)
19 TFile fFluct(fluctuationMap);
20 AliTPCCorrectionLookupTable *corrFluct = (AliTPCCorrectionLookupTable*)fFluct.Get("map");
23 TFile fAverage(averageMap);
24 AliTPCCorrectionLookupTable *corrAverage = (AliTPCCorrectionLookupTable*)fAverage.Get("map");
27 TObjArray *arrMaps = new TObjArray(2);
28 // !!!!! In AliTPCComposedCorrection::GetDistortion MakeInverseIterator is called !!!!
29 // for this reason we have to add the maps in the wrong order
31 arrMaps->Add(corrAverage); // correction with the average Map
32 arrMaps->Add(corrFluct); // distortion with the fluctuation Map
34 // create the composed correction
35 // if the weight are set to +1 and -1, the first map will be responsible for the distortions
36 // The second map for the corrections
37 AliTPCComposedCorrection *residualDistortion = new AliTPCComposedCorrection(arrMaps, AliTPCComposedCorrection::kQueueResidual);
43 weights(0)=-AliToyMCEventGenerator::GetSCScalingFactor(corrFluct, corrAverage,dummy);
45 residualDistortion->SetWeights(&weights);
47 return residualDistortion;