AliFMDDensityCalculator::AliFMDDensityCalculator()
: TNamed(),
fRingHistos(),
- fMultCut(0),
- fNXi(1),
- fIncludeSigma(true),
fSumOfWeights(0),
fWeightedSum(0),
fCorrections(0),
fLowCuts(0),
fEtaLumping(5),
fPhiLumping(5),
- fDebug(0)
+ fDebug(0),
+ fCuts()
{
//
// Constructor
AliFMDDensityCalculator::AliFMDDensityCalculator(const char* title)
: TNamed("fmdDensityCalculator", title),
fRingHistos(),
- fMultCut(0),
- fNXi(1),
- fIncludeSigma(true),
fSumOfWeights(0),
fWeightedSum(0),
fCorrections(0),
fLowCuts(0),
fEtaLumping(5),
fPhiLumping(5),
- fDebug(0)
+ fDebug(0),
+ fCuts()
{
//
// Constructor
AliFMDDensityCalculator& o)
: TNamed(o),
fRingHistos(),
- fMultCut(o.fMultCut),
- fNXi(o.fNXi),
- fIncludeSigma(o.fIncludeSigma),
fSumOfWeights(o.fSumOfWeights),
fWeightedSum(o.fWeightedSum),
fCorrections(o.fCorrections),
fLowCuts(o.fLowCuts),
fEtaLumping(o.fEtaLumping),
fPhiLumping(o.fPhiLumping),
- fDebug(o.fDebug)
+ fDebug(o.fDebug),
+ fCuts(o.fCuts)
{
//
// Copy constructor
//
TNamed::operator=(o);
- fMultCut = o.fMultCut;
- fNXi = o.fNXi;
- fIncludeSigma = o.fIncludeSigma;
- fDebug = o.fDebug;
- fMaxParticles = o.fMaxParticles;
- fUsePoisson = o.fUsePoisson;
- fUsePhiAcceptance = o.fUsePhiAcceptance;
- fAccI = o.fAccI;
- fAccO = o.fAccO;
- fFMD1iMax = o.fFMD1iMax;
- fFMD2iMax = o.fFMD2iMax;
- fFMD2oMax = o.fFMD2oMax;
- fFMD3iMax = o.fFMD3iMax;
- fFMD3oMax = o.fFMD3oMax;
- fMaxWeights = o.fMaxWeights;
- fLowCuts = o.fLowCuts;
- fEtaLumping = o.fEtaLumping;
- fPhiLumping = o.fPhiLumping;
+ fDebug = o.fDebug;
+ fMaxParticles = o.fMaxParticles;
+ fUsePoisson = o.fUsePoisson;
+ fUsePhiAcceptance = o.fUsePhiAcceptance;
+ fAccI = o.fAccI;
+ fAccO = o.fAccO;
+ fFMD1iMax = o.fFMD1iMax;
+ fFMD2iMax = o.fFMD2iMax;
+ fFMD2oMax = o.fFMD2oMax;
+ fFMD3iMax = o.fFMD3iMax;
+ fFMD3oMax = o.fFMD3oMax;
+ fMaxWeights = o.fMaxWeights;
+ fLowCuts = o.fLowCuts;
+ fEtaLumping = o.fEtaLumping;
+ fPhiLumping = o.fPhiLumping;
+ fCuts = o.fCuts;
+
fRingHistos.Delete();
TIter next(&o.fRingHistos);
TObject* obj = 0;
TIter next(&fRingHistos);
RingHistos* o = 0;
- while ((o = static_cast<RingHistos*>(next())))
+ while ((o = static_cast<RingHistos*>(next()))) {
o->Init(axis);
+ o->fMultCut = fCuts.GetFixedCut(o->fDet, o->fRing);
+ }
}
//____________________________________________________________________
return static_cast<RingHistos*>(fRingHistos.At(idx));
}
-//____________________________________________________________________
-void
-AliFMDDensityCalculator::SetMultCuts(Double_t fmd1i,
- Double_t fmd2i,
- Double_t fmd2o,
- Double_t fmd3i,
- Double_t fmd3o)
-{
- GetRingHistos(1,'I')->fMultCut = fmd1i;
- GetRingHistos(2,'I')->fMultCut = fmd2i;
- GetRingHistos(2,'O')->fMultCut = fmd2o;
- GetRingHistos(3,'I')->fMultCut = fmd3i;
- GetRingHistos(3,'O')->fMultCut = fmd3o;
- fMultCut = (fmd1i+fmd2i+fmd2o+fmd3i+fmd3o) / 5;
-}
-
//____________________________________________________________________
Double_t
AliFMDDensityCalculator::GetMultCut(UShort_t d, Char_t r, Int_t ieta,
// Return:
// Lower cut on multiplicity
//
- Double_t rcut = GetRingHistos(d, r)->fMultCut;
- // Int_t idx = (d == 1 ? 0 : 2*(d - 2) + 1 + ((r=='I' || r=='i') ? 0 : 1));
- // if (fMultCuts[idx] > 0) return fMultCuts[idx];
- if (rcut > 0) return rcut;
-
- AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
- AliFMDCorrELossFit* fits = fcm.GetELossFit();
- if (fNXi < 0) return fits->GetLowCut();
-
- return fits->GetLowerBound(d, r, ieta, fNXi, errors, fIncludeSigma);
+ return fCuts.GetMultCut(d,r,ieta,errors);
}
//____________________________________________________________________
// Return:
// Lower cut on multiplicity
//
- Double_t rcut = GetRingHistos(d, r)->fMultCut;
- if (rcut > 0) return rcut;
- if (fMultCut > 0) return fMultCut;
-
- AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
- AliFMDCorrELossFit* fits = fcm.GetELossFit();
- Int_t iEta = fits->FindEtaBin(eta);
-
- return GetMultCut(d, r, iEta, errors);
+ return fCuts.GetMultCut(d,r,eta,errors);
}
//____________________________________________________________________
d->Add(fMaxWeights);
d->Add(fLowCuts);
- TNamed* sigma = new TNamed("sigma",
- (fIncludeSigma ? "included" : "excluded"));
+ // TNamed* sigma = new TNamed("sigma",
+ // (fIncludeSigma ? "included" : "excluded"));
TNamed* maxP = new TNamed("maxParticle", Form("%d", fMaxParticles));
TNamed* method = new TNamed("method",
(fUsePoisson ? "Poisson" : "Energy loss"));
(fUsePhiAcceptance ? "enabled" : "disabled"));
TNamed* etaL = new TNamed("etaLumping", Form("%d", fEtaLumping));
TNamed* phiL = new TNamed("phiLumping", Form("%d", fPhiLumping));
- TParameter<double>* nxi = new TParameter<double>("nXi", fNXi);
+ // TParameter<double>* nxi = new TParameter<double>("nXi", fNXi);
- d->Add(sigma);
+ // d->Add(sigma);
d->Add(maxP);
d->Add(method);
d->Add(phiA);
d->Add(etaL);
d->Add(phiL);
- d->Add(nxi);
+ // d->Add(nxi);
+ fCuts.Output(d,0);
TIter next(&fRingHistos);
RingHistos* o = 0;
ind[gROOT->GetDirLevel()] = '\0';
std::cout << ind << ClassName() << ": " << GetName() << '\n'
<< std::boolalpha
- << ind << " Multiplicity cut: " << fMultCut << '\n'
- << ind << " # of (xi+sigma) factor: " << fNXi << '\n'
- << ind << " Include sigma in cut: " << fIncludeSigma << '\n'
- << ind << " Low cut method: "
- << (fMultCut > 0 ? "fixed" :
- (fNXi >= 0 ? "xi+sigma" : "fit range")) << '\n'
<< ind << " Max(particles): " << fMaxParticles << '\n'
<< ind << " Poisson method: " << fUsePoisson << '\n'
<< ind << " Use phi acceptance: " << fUsePhiAcceptance << '\n'
<< ind << " Phi lumping: " << fPhiLumping << '\n'
<< std::noboolalpha
<< std::flush;
+ std::cout << ind << " Lower cut:" << std::endl;
+ fCuts.Print();
TString opt(option);
opt.ToLower();
if (opt.Contains("nomax")) return;
fEmptyStrips(0),
fBasicHits(0),
fEmptyVsTotal(0),
+ fELoss(0),
fELossUsed(0),
fMultCut(0)
{
#include <TList.h>
#include <TArrayI.h>
#include "AliForwardUtil.h"
+#include "AliFMDMultCuts.h"
class AliESDFMD;
class TH2D;
class TH1D;
*
* @param cut Cut to use
*/
- void SetMultCut(Double_t cut) { SetMultCuts(cut,cut,cut,cut,cut); }
+ void SetMultCut(Double_t cut) { fCuts.SetMultCuts(cut,cut,cut,cut,cut); }
/**
* Set the lower multiplicity cuts
*
*
* @param n Number of @f$ \xi@f$
*/
- void SetNXi(Double_t nXi) { fNXi = nXi; }
+ void SetNXi(Double_t nXi) { fCuts.SetNXi(nXi); /* fNXi = nXi;*/ }
/**
* Whether to include sigma in the number subtracted from the MPV to
* get the low cut
*
* @param u If true, then low cut is @f$ \Delta_{mp} - n(\xi+\sigma)@f$
*/
- void SetIncludeSigma(Bool_t u) { fIncludeSigma = u; }
+ void SetIncludeSigma(Bool_t u) { fCuts.SetIncludeSigma(u); /*fIncludeSigma = u;*/ }
+ /**
+ *
+ * Set the fraction of MPV
+ *
+ * @param cut if true cut at fraction of MPV
+ */
+ void SetFractionOfMPV(Double_t cut) { fCuts.SetMPVFraction(cut); /*fFractionOfMPV = cut;*/ }
/**
* Get the multiplicity cut. If the user has set fMultCut (via
* SetMultCut) then that value is used. If not, then the lower
* - max Print max weights
*/
void Print(Option_t* option="") const;
+ AliFMDMultCuts& GetCuts() { return fCuts; }
+ void SetCuts(const AliFMDMultCuts& c) { fCuts = c; }
protected:
/**
* Find the max weight to use for FMD<i>dr</i> in eta bin @a iEta
* @return Ring histogram container
*/
RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
-
TList fRingHistos; // List of histogram containers
- Double_t fMultCut; // Low cut on scaled energy loss
- Double_t fNXi; // Delta-n(xi+sigma) factor
- Bool_t fIncludeSigma; // Whether or not to include sigma in cut
TH1D* fSumOfWeights; // Histogram
TH1D* fWeightedSum; // Histogram
TH1D* fCorrections; // Histogram
Int_t fEtaLumping; // How to lump eta bins for Poisson
Int_t fPhiLumping; // How to lump phi bins for Poisson
Int_t fDebug; // Debug level
- // Double_t fMultCuts[5]; // Per-ring multiplicity cuts
+ AliFMDMultCuts fCuts; // Cuts
- ClassDef(AliFMDDensityCalculator,4); // Calculate Nch density
+ ClassDef(AliFMDDensityCalculator,6); // Calculate Nch density
};
#endif
AliFMDSharingFilter::AliFMDSharingFilter()
: TNamed(),
fRingHistos(),
- fLowCut(0.),
fCorrectAngles(kFALSE),
fNXi(1),
fIncludeSigma(true),
fSummed(0),
fHighCuts(0),
+ fLowCuts(0),
fOper(0),
fDebug(0),
- fZeroSharedHitsBelowThreshold(false)
+ fZeroSharedHitsBelowThreshold(false),
+ fLCuts(),
+ fHCuts()
{
//
// Default Constructor - do not use
AliFMDSharingFilter::AliFMDSharingFilter(const char* title)
: TNamed("fmdSharingFilter", title),
fRingHistos(),
- fLowCut(0.),
fCorrectAngles(kFALSE),
fNXi(1),
fIncludeSigma(true),
fSummed(0),
fHighCuts(0),
+ fLowCuts(0),
fOper(0),
fDebug(0),
- fZeroSharedHitsBelowThreshold(false)
+ fZeroSharedHitsBelowThreshold(false),
+ fLCuts(),
+ fHCuts()
{
//
// Constructor
fRingHistos.Add(new RingHistos(2, 'O'));
fRingHistos.Add(new RingHistos(3, 'I'));
fRingHistos.Add(new RingHistos(3, 'O'));
+
+ fHCuts.SetNXi(1);
+ fHCuts.SetIncludeSigma(1);
+ fLCuts.SetMultCuts(.15);
}
//____________________________________________________________________
AliFMDSharingFilter::AliFMDSharingFilter(const AliFMDSharingFilter& o)
: TNamed(o),
fRingHistos(),
- fLowCut(o.fLowCut),
fCorrectAngles(o.fCorrectAngles),
fNXi(o.fNXi),
fIncludeSigma(o.fIncludeSigma),
fSummed(o.fSummed),
fHighCuts(o.fHighCuts),
+ fLowCuts(o.fLowCuts),
fOper(o.fOper),
fDebug(o.fDebug),
- fZeroSharedHitsBelowThreshold(o.fZeroSharedHitsBelowThreshold)
+ fZeroSharedHitsBelowThreshold(o.fZeroSharedHitsBelowThreshold),
+ fLCuts(o.fLCuts),
+ fHCuts(o.fHCuts)
{
//
// Copy constructor
//
TNamed::operator=(o);
- fLowCut = o.fLowCut;
fCorrectAngles = o.fCorrectAngles;
fNXi = o.fNXi;
fDebug = o.fDebug;
fOper = o.fOper;
fSummed = o.fSummed;
fHighCuts = o.fHighCuts;
+ fLowCuts = o.fLowCuts;
fIncludeSigma = o.fIncludeSigma;
fZeroSharedHitsBelowThreshold = o.fZeroSharedHitsBelowThreshold;
-
+ fLCuts = o.fLCuts;
+ fHCuts = o.fHCuts;
+
fRingHistos.Delete();
TIter next(&o.fRingHistos);
TObject* obj = 0;
fHighCuts->GetYaxis()->SetBinLabel(4, "FMD3i");
fHighCuts->GetYaxis()->SetBinLabel(5, "FMD3o");
+ fLowCuts->SetBins(nEta, eAxis.GetXmin(), eAxis.GetXmax(), 5, .5, 5.5);
+ fLowCuts->GetYaxis()->SetBinLabel(1, "FMD1i");
+ fLowCuts->GetYaxis()->SetBinLabel(2, "FMD2i");
+ fLowCuts->GetYaxis()->SetBinLabel(3, "FMD2o");
+ fLowCuts->GetYaxis()->SetBinLabel(4, "FMD3i");
+ fLowCuts->GetYaxis()->SetBinLabel(5, "FMD3o");
+
UShort_t ybin = 0;
for (UShort_t d = 1; d <= 3; d++) {
UShort_t nr = (d == 1 ? 1 : 2);
ybin++;
for (UShort_t e = 1; e <= nEta; e++) {
Double_t eta = eAxis.GetBinCenter(e);
- Double_t cut = GetHighCut(d, r, eta, false);
- if (cut <= 0) continue;
- fHighCuts->SetBinContent(e, ybin, cut);
+ Double_t hcut = GetHighCut(d, r, eta, false);
+ Double_t lcut = GetLowCut(d, r, eta);
+ if (hcut > 0) fHighCuts->SetBinContent(e, ybin, hcut);
+ if (lcut > 0) fLowCuts ->SetBinContent(e, ybin, lcut);
}
}
}
}
//_____________________________________________________________________
Double_t
-AliFMDSharingFilter::GetLowCut(UShort_t, Char_t, Double_t) const
+AliFMDSharingFilter::GetLowCut(UShort_t d, Char_t r, Double_t eta) const
{
//
// Get the low cut. Normally, the low cut is taken to be the lower
// However, if fLowCut is set (using SetLowCit) to a value greater
// than 0, then that value is used.
//
- if (fLowCut > 0) return fLowCut;
+ return fLCuts.GetMultCut(d,r,eta,false);
+#if 0
+ if (!fCutAtFractionOfMPV && fLowCut > 0) return fLowCut;
+
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
AliFMDCorrELossFit* fits = fcm.GetELossFit();
+
+ if (fCutAtFractionOfMPV) {
+ AliFMDCorrELossFit::ELossFit* func = fits->GetFit(d,r,eta);
+ return fFractionOfMPV*func->GetDelta() ;
+ }
return fits->GetLowCut();
+#endif
}
//_____________________________________________________________________
// most-probably-value peak found from the energy distributions, minus
// 2 times the width of the corresponding Landau.
//
+ return fHCuts.GetMultCut(d,r,eta,errors);
+#if 0
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
AliFMDCorrELossFit* fits = fcm.GetELossFit();
return fits->GetLowerBound(d, r, eta, fNXi, errors, fIncludeSigma);
+#endif
}
//_____________________________________________________________________
fHighCuts->SetDirectory(0);
d->Add(fHighCuts);
- TParameter<double>* lowCut = new TParameter<double>("lowCut", fLowCut);
- TParameter<double>* nXi = new TParameter<double>("nXi", fNXi);
- TNamed* sigma = new TNamed("sigma", fIncludeSigma ?
- "included" : "excluded");
- sigma->SetUniqueID(fIncludeSigma);
+ fLowCuts = new TH2D("lowCuts", "Low cuts used", 1,0,1, 1,0,1);
+ fLowCuts->SetXTitle("#eta");
+ fLowCuts->SetDirectory(0);
+ d->Add(fLowCuts);
+
+ // TParameter<double>* lowCut = new TParameter<double>("lowCut", fLowCut);
+ // TParameter<double>* nXi = new TParameter<double>("nXi", fNXi);
+ // TNamed* sigma = new TNamed("sigma", fIncludeSigma ?
+ // "included" : "excluded");
+ // sigma->SetUniqueID(fIncludeSigma);
TNamed* angle = new TNamed("angle", fCorrectAngles ?
"corrected" : "uncorrected");
angle->SetUniqueID(fCorrectAngles);
fZeroSharedHitsBelowThreshold ?
"zeroed" : "kept");
low->SetUniqueID(fZeroSharedHitsBelowThreshold);
- d->Add(lowCut);
- d->Add(nXi);
- d->Add(sigma);
+ // d->Add(lowCut);
+ // d->Add(nXi);
+ // d->Add(sigma);
d->Add(angle);
d->Add(low);
-
-
+ fLCuts.Output(d,"lCuts");
+ fHCuts.Output(d,"hCuts");
TIter next(&fRingHistos);
RingHistos* o = 0;
std::cout << ind << ClassName() << ": " << GetName() << '\n'
<< std::boolalpha
<< ind << " Debug: " << fDebug << "\n"
- << ind << " Low cut: " << fLowCut << '\n'
- << ind << " N xi factor: " << fNXi << '\n'
- << ind << " Include sigma in cut: " << fIncludeSigma << '\n'
<< ind << " Use corrected angles: " << fCorrectAngles << '\n'
<< ind << " Zero below threshold: "
<< fZeroSharedHitsBelowThreshold
<< std::noboolalpha << std::endl;
+ std::cout << ind << " Low cuts: " << std::endl;
+ fLCuts.Print();
+ std::cout << ind << " High cuts: " << std::endl;
+ fHCuts.Print();
}
//====================================================================
#include <TH2.h>
#include <TList.h>
#include "AliForwardUtil.h"
+#include "AliFMDMultCuts.h"
class AliESDFMD;
class TAxis;
class TList;
*
* @param lowCut Low cut
*/
- void SetLowCut(Double_t lowCut=0) { fLowCut = lowCut; }
+ void SetLowCut(Double_t lowCut=0) { fLCuts.SetMultCuts(lowCut); }
/**
* Reset the low cut for sharing to use the fit range lower cut
*
*/
- void UnsetLowCut() { fLowCut = 0; }
+ void UnsetLowCut() { fLCuts.SetMultCuts(0); }
/**
* Set the debug level. The higher the value the more output
*
*
* @param n Number of @f$ \xi@f$
*/
- void SetNXi(Double_t n) { fNXi = n; }
+ void SetNXi(Double_t n) { fHCuts.SetNXi(n); /* fNXi = n; */ }
/**
* Whether to include sigma in the number subtracted from the MPV to
* get the high cut
*
* @param u If true, then high cut is @f$ \Delta_{mp} - n(\xi+\sigma)@f$
*/
- void SetIncludeSigma(Bool_t u) { fIncludeSigma = u; }
+ void SetIncludeSigma(Bool_t u) { fHCuts.SetIncludeSigma(u); /*fIncludeSigma = u;*/ }
/**
* Filter the input AliESDFMD object
*
Bool_t Filter(const AliESDFMD& input,
Bool_t lowFlux,
AliESDFMD& output);
+ /**
+ *
+ * Set the fraction of MPV
+ *
+ * @param u if true cut at fraction of MPV
+ */
+ void SetFractionOfMPV(Double_t cut) { fHCuts.SetMPVFraction(cut); /* fFractionOfMPV = cut;*/ }
/**
* Scale the histograms to the total number of events
*
* @param option Not used
*/
virtual void Print(Option_t* option="") const;
+
+ AliFMDMultCuts& GetLCuts() { return fLCuts; }
+ AliFMDMultCuts& GetHCuts() { return fHCuts; }
+ const AliFMDMultCuts& GetLCuts() const { return fLCuts; }
+ const AliFMDMultCuts& GetHCuts() const { return fHCuts; }
+ void SetLCuts(const AliFMDMultCuts& c) { fLCuts = c; }
+ void SetHCuts(const AliFMDMultCuts& c) { fHCuts = c; }
protected:
/**
* Internal data structure to keep track of the histograms
virtual Double_t GetLowCut(UShort_t d, Char_t r, Double_t eta) const;
TList fRingHistos; // List of histogram containers
- Double_t fLowCut; // Low cut on sharing
+ // Double_t fLowCut; // Low cut on sharing
Bool_t fCorrectAngles; // Whether to work on angle corrected signals
Double_t fNXi; // Number of xi's from Delta to stop merging
Bool_t fIncludeSigma; // Whether to include sigma in cut
TH2* fSummed; // Operations histogram
TH2* fHighCuts; // High cuts used
+ TH2* fLowCuts; // High cuts used
AliFMDFloatMap* fOper; // Operation done per strip
Int_t fDebug; // Debug level
Bool_t fZeroSharedHitsBelowThreshold; //Whether to zero shared strip below cut
-
- ClassDef(AliFMDSharingFilter,2); //
+ AliFMDMultCuts fLCuts;
+ AliFMDMultCuts fHCuts;
+
+ ClassDef(AliFMDSharingFilter,3); //
};
#endif