fEtaLumping(32),
fPhiLumping(4),
fDebug(0),
- fCuts()
+ fCuts(),
+ fRecalculateEta(false)
{
//
// Constructor
fEtaLumping(32),
fPhiLumping(4),
fDebug(0),
- fCuts()
+ fCuts(),
+ fRecalculateEta(false)
{
//
// Constructor
fEtaLumping(o.fEtaLumping),
fPhiLumping(o.fPhiLumping),
fDebug(o.fDebug),
- fCuts(o.fCuts)
+ fCuts(o.fCuts),
+ fRecalculateEta(o.fRecalculateEta)
{
//
// Copy constructor
fEtaLumping = o.fEtaLumping;
fPhiLumping = o.fPhiLumping;
fCuts = o.fCuts;
+ fRecalculateEta = o.fRecalculateEta;
fRingHistos.Delete();
TIter next(&o.fRingHistos);
AliForwardUtil::Histos& hists,
UShort_t vtxbin,
Bool_t lowFlux,
- Double_t /* cent */)
+ Double_t cent,
+ Double_t zvtx)
{
//
// Do the calculations
Float_t mult = fmd.Multiplicity(d,r,s,t);
Float_t phi = fmd.Phi(d,r,s,t) / 180 * TMath::Pi();
Float_t eta = fmd.Eta(d,r,s,t);
+
+
+ if(fRecalculateEta)
+ eta = AliForwardUtil::GetEtaFromStrip(d,r,s,t,zvtx);
if (mult == AliESDFMD::kInvalidMult || mult > 20) {
rh->fPoisson.Fill(t , s, false);
Double_t poissonV = poisson->GetBinContent(t+1,s+1);
Double_t phi = fmd.Phi(d,r,s,t) / 180 * TMath::Pi();
Double_t eta = fmd.Eta(d,r,s,t);
+ if(fRecalculateEta)
+ eta = AliForwardUtil::GetEtaFromStrip(d,r,s,t,zvtx);
if (fUsePoisson)
h->Fill(eta,phi,poissonV);
else
*/
virtual Bool_t Calculate(const AliESDFMD& fmd,
AliForwardUtil::Histos& hists,
- UShort_t vtxBin, Bool_t lowFlux, Double_t cent=-1);
+ UShort_t vtxBin, Bool_t lowFlux, Double_t cent=-1, Double_t vz=0);
/**
* Scale the histograms to the total number of events
*
* number of particles that has hit within a region.
*/
void SetUsePoisson(Bool_t u) { fUsePoisson = u; }
+ /**
+ * In case of a displaced vertices recalculate eta and angle correction
+ *
+ * @param use recalculate or not
+ *
+ */
+ void SetRecalculateEta(Bool_t use) { fRecalculateEta = use; }
/**
* Set whether to use the phi acceptance correction.
*
*
* @param u If >0, use the phi acceptance (default is false)
*/
+
void SetUsePhiAcceptance(UShort_t u=kPhiCorrectNch) { fUsePhiAcceptance = u; }
/**
* Set the luming factors used in the Poisson method
Int_t fPhiLumping; // How to lump phi bins for Poisson
Int_t fDebug; // Debug level
AliFMDMultCuts fCuts; // Cuts
+ Bool_t fRecalculateEta; // //Whether to recalculate eta and angle correction (disp vtx)
ClassDef(AliFMDDensityCalculator,7); // Calculate Nch density
};
fLCuts(),
fHCuts(),
fUseSimpleMerging(false),
- fThreeStripSharing(true)
+ fThreeStripSharing(true),
+ fRecalculateEta(false)
{
//
// Default Constructor - do not use
fLCuts(),
fHCuts(),
fUseSimpleMerging(false),
- fThreeStripSharing(true)
+ fThreeStripSharing(true),
+ fRecalculateEta(false)
{
//
// Constructor
fLCuts(o.fLCuts),
fHCuts(o.fHCuts),
fUseSimpleMerging(o.fUseSimpleMerging),
- fThreeStripSharing(o.fThreeStripSharing)
+ fThreeStripSharing(o.fThreeStripSharing),
+ fRecalculateEta(o.fRecalculateEta)
{
//
// Copy constructor
fHCuts = o.fHCuts;
fUseSimpleMerging = o.fUseSimpleMerging;
fThreeStripSharing = o.fThreeStripSharing;
+ fRecalculateEta = o.fRecalculateEta;
fRingHistos.Delete();
TIter next(&o.fRingHistos);
Bool_t
AliFMDSharingFilter::Filter(const AliESDFMD& input,
Bool_t lowFlux,
- AliESDFMD& output)
+ AliESDFMD& output,
+ Double_t zvtx)
{
//
// Filter the input AliESDFMD object
Double_t phi = input.Phi(d,r,s,t) * TMath::Pi() / 180.;
if (s == 0) output.SetEta(d,r,s,t,eta);
+ Double_t etaOld = eta;
+ Double_t etaCalc = 0;
+ if(fRecalculateEta) {
+ etaCalc = AliForwardUtil::GetEtaFromStrip(d,r,s,t,zvtx);
+ eta = etaCalc;
+ }
+ if(fRecalculateEta && mult > 0 && mult != AliESDFMD::kInvalidMult ) {
+ Double_t cosOld = TMath::Cos(2*TMath::ATan(TMath::Exp(-1*TMath::Abs(etaOld))));
+ Double_t cosNew = TMath::Cos(2*TMath::ATan(TMath::Exp(-1*TMath::Abs(etaCalc))));
+ if(mult > 0) mult = (mult/cosOld)*cosNew;
+ if(multNext > 0) multNext = (multNext/cosOld)*cosNew;
+ if(multNextNext > 0) multNextNext = (multNextNext/cosOld)*cosNew;
+
+ //No corrections beyond this point
+ // if(eta < -4) {
+ // mult = 0; multNext = 0; multNextNext = 0;
+ // }
+ }
+
// Keep dead-channel information.
if(mult == AliESDFMD::kInvalidMult)
output.SetMultiplicity(d,r,s,t,AliESDFMD::kInvalidMult);
*
*/
void SetAllow3Strips(Bool_t use) { fThreeStripSharing = use; }
+
+ /**
+ * In case of a displaced vertices recalculate eta and angle correction
+ *
+ * @param use recalculate or not
+ *
+ */
+ void SetRecalculateEta(Bool_t use) { fRecalculateEta = use; }
+
/**
* Filter the input AliESDFMD object
*
*/
Bool_t Filter(const AliESDFMD& input,
Bool_t lowFlux,
- AliESDFMD& output);
+ AliESDFMD& output,
+ Double_t zvtx);
/**
* Scale the histograms to the total number of events
*
AliFMDMultCuts fHCuts; //Cuts object for high cuts
Bool_t fUseSimpleMerging; //enable simple sharing by HHD
Bool_t fThreeStripSharing; //In case of simple sharing allow 3 strips
+ Bool_t fRecalculateEta; //Whether to recalculate eta and angle correction (disp vtx)
ClassDef(AliFMDSharingFilter,4); //
};
AliESDFMD* esdFMD = esd->GetFMDData();
// Apply the sharing filter (or hit merging or clustering if you like)
- if (isAccepted && !fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD)) {
+ if (isAccepted && !fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD, vz)) {
AliWarning("Sharing filter failed!");
return;
}
// Get FMD data
AliESDFMD* esdFMD = esd->GetFMDData();
// // Apply the sharing filter (or hit merging or clustering if you like)
- if (!fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD)) {
+ if (!fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD, vz)) {
AliWarning("Sharing filter failed!");
return;
}
// Calculate the inclusive charged particle density
- if (!fDensityCalculator.Calculate(fESDFMD, fHistos, ivz, lowFlux, cent)) {
+ if (!fDensityCalculator.Calculate(fESDFMD, fHistos, ivz, lowFlux, cent,vz)) {
// if (!fDensityCalculator.Calculate(*esdFMD, fHistos, ivz, lowFlux)) {
AliWarning("Density calculator failed!");
return;
}
// // Apply the sharing filter (or hit merging or clustering if you like)
- if (!fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD)) {
+ if (!fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD, vz)) {
AliWarning("Sharing filter failed!");
return;
}
//
return Form("%01dkG", f);
}
+//_____________________________________________________________________
+Double_t AliForwardUtil::GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Double_t zvtx)
+{
+ //Calculate eta from strip with vertex (redundant with AliESDFMD::Eta but support displaced vertices)
+
+ //Get max R of ring
+ Double_t maxR = 0;
+ Double_t minR = 0;
+ Bool_t inner = false;
+ switch (ring) {
+ case 'i': case 'I': maxR = 17.2; minR = 4.5213; inner = true; break;
+ case 'o': case 'O': maxR = 28.0; minR = 15.4; inner = false; break;
+ default:
+ return -99999;
+ }
+
+ Double_t rad = maxR- minR;
+ Double_t nStrips = (ring == 'I' ? 512 : 256);
+ Double_t segment = rad / nStrips;
+ Double_t r = minR + segment*strip;
+ Int_t hybrid = sec / 2;
+
+ Double_t z = 0;
+ switch (det) {
+ case 1: z = 320.266; break;
+ case 2: z = (inner ? 83.666 : 74.966); break;
+ case 3: z = (inner ? -63.066 : -74.966); break;
+ default: return -999999;
+ }
+ if ((hybrid % 2) == 0) z -= .5;
+
+ Double_t theta = TMath::ATan2(r,z-zvtx);
+ Double_t eta = -1*TMath::Log(TMath::Tan(0.5*theta));
+
+ return eta;
+}
//====================================================================
* @return Short integer value of magnetic field in kG
*/
static Short_t ParseMagneticField(Float_t field);
+ /**
+ * Get eta from strip
+ *
+ * @param det, ring, sec, strip, zvtx
+ *
+ * @return eta
+ */
+ static Double_t GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Double_t zvtx) ;
/**
* Get a string representation of the magnetic field
*
*
* @return String representation of the magnetic field
*/
- static const char* MagneticFieldString(Short_t field);
+ static const char* MagneticFieldString(Short_t field);
/* @} */
/**