10 #include <TObjArray.h> 14 #include <TInterpreter.h> 25 fRecalculateEta(true),
28 fInvalidIsEmpty(false),
67 if (&o ==
this)
return *
this;
114 extraDead->SetOwner();
115 extraDead->SetName(
"extraDead");
119 for (
UInt_t i = firstBit; i < nBits; i++) {
120 if (!
fXtraDead.TestBitNumber(i))
continue;
137 if (d < 1 || d > 3) {
138 Warning(
"AddDead",
"Invalid detector FMD%d", d);
141 Bool_t inner = (r ==
'I' || r ==
'i');
142 if (d == 1 && !inner) {
143 Warning(
"AddDead",
"Invalid ring FMD%d%c", d, r);
146 if ((inner && s >= 20) || (!inner && s >= 40)) {
147 Warning(
"AddDead",
"Invalid sector FMD%d%c[%02d]", d, r, s);
150 if ((inner && t >= 512) || (!inner && t >= 256)) {
151 Warning(
"AddDead",
"Invalid strip FMD%d%c[%02d,%03d]", d, r, s, t);
167 for (
Int_t s = s1; s <= s2; s++)
168 for (
Int_t t = t1; t <= t2; t++)
175 if (!script || script[0] ==
'\0')
return;
177 const char* scr =
gSystem->Which(gROOT->GetMacroPath(), script);
179 AliWarningF(
"%s not found in %s", script, gROOT->GetMacroPath());
182 AliInfoF(
"Reading additional dead strips from %s", scr);
184 gROOT->Macro(Form(
"%s((AliFMDESDFixer*)%p);", scr,
this));
186 gInterpreter->UnloadFile(scr);
207 if (AliESDFMD::Class_Version() < 4) {
212 if (!esd.TestBit(1 << 14)) {
218 if (!esd.NeedNoiseFix()) {
223 target =
Int_t(esd.GetNoiseFactor());
232 if (target <= 0)
return 0;
242 #define ETA2COS(ETA) \ 243 TMath::Cos(2*TMath::ATan(TMath::Exp(-TMath::Abs(ETA)))) 264 Char_t r = (q == 0 ?
'I' :
'O');
270 Double_t mult = esd.Multiplicity(d,r,s,t);
280 if (ng && mult != AliESDFMD::kInvalidMult) {
281 if (cosTheta <= 0) cosTheta =
ETA2COS(eta);
287 if (mult >= AliESDFMD::kInvalidMult) mult = AliESDFMD::kInvalidMult;
288 esd.SetMultiplicity(d,r,s,t,mult);
289 esd.SetEta(d,r,s,t,eta);
307 mult = AliESDFMD::kInvalidMult;
320 Double_t oldEta = eta, newEta = eta, newPhi=0;
325 if (TMath::Abs(eta) < 1) {
326 ::Warning(
"RecalculateEta",
327 "FMD%d%c[%2d,%3d] (%f,%f,%f) eta=%f phi=%f (was %f)",
328 d, r, s, t, ip.X(), ip.Y(), ip.Z(), newEta, newPhi, oldEta);
335 if (mult == AliESDFMD::kInvalidMult)
return;
349 mult = AliESDFMD::kInvalidMult;
352 Double_t add = corr * target * cosTheta;
359 #define PF(N,V,...) \ 360 AliForwardUtil::PrintField(N,V, ## __VA_ARGS__) 361 #define PFB(N,FLAG) \ 363 AliForwardUtil::PrintName(N); \ 364 std::cout << std::boolalpha << (FLAG) << std::noboolalpha << std::endl; \ 366 #define PFV(N,VALUE) \ 368 AliForwardUtil::PrintName(N); \ 369 std::cout << (VALUE) << std::endl; } while(false) 376 gROOT->IncreaseDirLevel();
382 gROOT->DecreaseDirLevel();
Bool_t NoiseCorrect(Int_t f, Double_t c, Double_t cosTheta, Double_t &mult)
void RecalculateEta(UShort_t d, Char_t r, UShort_t s, UShort_t t, const TVector3 &ip, Double_t &mult, Double_t &eta, Double_t &cosTheta)
AliFMDESDFixer & operator=(const AliFMDESDFixer &)
void Print(Option_t *option="") const
void AddDead(UShort_t d, Char_t r, UShort_t s, UShort_t t)
static Bool_t GetEtaPhi(UShort_t det, Char_t ring, UShort_t sec, UShort_t str, const TVector3 &ip, Double_t &eta, Double_t &phi)
Float_t Get(UShort_t d, Char_t r, UShort_t s, UShort_t t) const
const char * GetName() const
Int_t FindTargetNoiseFactor(const AliESDFMD &esd, Bool_t check=true) const
Bool_t CheckDead(UShort_t d, Char_t r, UShort_t s, UShort_t t, Double_t &m)
Various utilities used in PWGLF/FORWARD.
static UInt_t Pack(UShort_t det, Char_t rng, UShort_t sec, UShort_t str)
virtual Bool_t IsDead(UShort_t d, Char_t r, UShort_t s, UShort_t t) const
void AddDeadRegion(UShort_t d, Char_t r, UShort_t s1, UShort_t s2, UShort_t t1, UShort_t t2)
const AliFMDCorrNoiseGain * GetNoiseGain() const
void CreateOutputObjects(TList *l)
static void PrintTask(const TObject &o)
static TObject * MakeParameter(const char *name, UShort_t value)
void Fix(AliESDFMD &esd, const TVector3 &ip)
static AliForwardCorrectionManager & Instance()
static void Unpack(UInt_t id, UShort_t &det, Char_t &rng, UShort_t &sec, UShort_t &str)
Bool_t IsUseNoiseCorrection() const