#include <TH1D.h>
#include <THStack.h>
#include <TList.h>
-#include <TParameter.h>
#include <AliAnalysisManager.h>
#include <AliAODEvent.h>
#include <AliAODHandler.h>
fSchemeString->SetTitle(tit);
fSchemeString->SetUniqueID(fNormalizationScheme);
#else
- if (!fSchemeString)
- fSchemeString = new TParameter<int>("scheme", scheme);
- fSchemeString->SetUniqueID(fNormalizationScheme);
+ if (fSchemeString) delete fSchemeString;
+ fSchemeString = AliForwardUtil::MakeParameter("scheme", scheme);
#endif
}
//________________________________________________________________________
fTriggerString->SetTitle(tit);
fTriggerString->SetUniqueID(fTriggerMask);
#else
- if (!fTriggerString)
- fTriggerString = new TParameter<int>("trigger", fTriggerMask);
- fTriggerString->SetUniqueID(fTriggerMask);
+ if (fTriggerString) delete fTriggerString;
+ fTriggerString = AliForwardUtil::MakeParameter("trigger", fTriggerMask);
#endif
}
}
#else
if (!fSNNString) {
- UShort_t sNN = forward->GetSNN();
- fSNNString = new TParameter<int>("sNN", sNN);
- fSNNString->SetUniqueID(sNN);
+ fSNNString = AliForwardUtil::MakeParameter("sNN", forward->GetSNN());
+ fSysString = AliForwardUtil::MakeParameter("sys", forward->GetSystem());
+
fSums->Add(fSNNString);
-
- UShort_t sys = forward->GetSystem();
- fSysString = new TParameter<int>("sys", sys);
- fSysString->SetUniqueID(sys);
fSums->Add(fSysString);
-
fSums->Add(fSchemeString);
fSums->Add(fTriggerString);
fOutput->SetName(Form("%s_result", GetName()));
fOutput->SetOwner();
- fSNNString = static_cast<TParameter<int>*>(fSums->FindObject("sNN"));
- fSysString = static_cast<TParameter<int>*>(fSums->FindObject("sys"));
+ fSNNString = fSums->FindObject("sNN");
+ fSysString = fSums->FindObject("sys");
fCentAxis = static_cast<TAxis*>(fSums->FindObject("centAxis"));
- fSchemeString = static_cast<TParameter<int>*>(fSums->FindObject("scheme"));
- fTriggerString = static_cast<TParameter<int>*>(fSums->FindObject("trigger"));
+ fSchemeString = fSums->FindObject("scheme");
+ fTriggerString = fSums->FindObject("trigger");
if(fSysString && fSNNString &&
fSysString->GetUniqueID() == AliForwardUtil::kPP)
fOutput->Add(vtxAxis);
// Output trigger efficiency and shape correction
- fOutput->Add(new TParameter<Double_t>("triggerEff", fTriggerEff));
+ fOutput->Add(AliForwardUtil::MakeParameter("triggerEff", fTriggerEff));
if (fShapeCorr) fOutput->Add(fShapeCorr);
TNamed* options = new TNamed("options","");
fTriggerMask == AliAODForwardMult::kNSD ? "nsd" :
fTriggerMask == AliAODForwardMult::kInelGt0 ?
"inelgt0" : "all"));
- TParameter<float>* eff = 0;
- if (fNormalizationScheme & kTriggerEfficiency)
- eff = static_cast<TParameter<float>*>(fin->Get(effName));
- Double_t trigEff = eff ? eff->GetVal() : 1;
+
+ Double_t trigEff = 1;
+ if (fNormalizationScheme & kTriggerEfficiency) {
+ TObject* eff = fin->Get(effName);
+ if (eff) AliForwardUtil::GetParameter(eff, trigEff);
+ }
if (fTriggerEff != 1) SetTriggerEff(trigEff);
if (fTriggerEff < 0) fTriggerEff = 1;
*
*/
#include <AliAnalysisTaskSE.h>
-#include <TParameter.h>
class TAxis;
class TList;
class TH2D;
TNamed* fSNNString; // sqrt(s_NN) string
TNamed* fSysString; // Collision system string
#else
- TParameter<int>* fSNNString; // sqrt(s_NN) string
- TParameter<int>* fSysString; // Collision system string
+ TObject* fSNNString; // sqrt(s_NN) string
+ TObject* fSysString; // Collision system string
#endif
TH1D* fCent; // Centrality distribution
TAxis* fCentAxis; // Centrality axis
TNamed* fSchemeString; // Normalization scheme string
TNamed* fTriggerString; // Trigger string
#else
- TParameter<int>* fSchemeString; // Normalization scheme string
- TParameter<int>* fTriggerString; // Trigger string
+ TObject* fSchemeString; // Normalization scheme string
+ TObject* fTriggerString; // Trigger string
#endif
TString fFinalMCCorrFile; //Filename for final MC corr
- ClassDef(AliBasedNdetaTask,7); // Determine multiplicity in base area
+ ClassDef(AliBasedNdetaTask,8); // Determine multiplicity in base area
};
#endif
{
return Form("nEvents%s%s", (tr ? "Tr" : ""), (vtx ? "Vtx" : ""));
}
- /*const char* GetHitsName(UShort_t d, Char_t r)
- {
- return Form("hitsSPD%d%c", d, r);
- }
- const char* GetStripsName(UShort_t d, Char_t r)
- {
- return Form("stripsSPD%d%c", d, r);
- }
- const char* GetPrimaryName(Char_t r, Bool_t trVtx)
- {
- return Form("primaries%s%s",
- ((r == 'I' || r == 'i') ? "Inner" : "Outer"),
- (trVtx ? "TrVtx" : "All"));
- }
- */
}
//====================================================================
UShort_t iVzMc; // Vertex bin from MC
Double_t vZMc; // Z coordinate of IP vertex from MC
Double_t b; // Impact parameter
+ Double_t cMC; // Centrality estimate from b
Int_t nPart; // Number of participants
Int_t nBin; // Number of binary collisions
Double_t phiR; // Reaction plane from MC
UInt_t retESD = fInspector.Process(esd, triggers, lowFlux, iVz, vZ,
cent, nClusters);
fInspector.ProcessMC(mcEvent, triggers, iVzMc, vZMc,
- b, nPart, nBin, phiR);
+ b, cMC, nPart, nBin, phiR);
Bool_t isInel = triggers & AliAODForwardMult::kInel;
Bool_t hasVtx = retESD == AliFMDMCEventInspector::kOk;
//____________________________________________________________________
AliDisplacedVertexSelection::AliDisplacedVertexSelection()
- : TObject()
+ : TObject(),
+ fVertexZ(9999),
+ fCent(100)
{
}
//____________________________________________________________________
AliDisplacedVertexSelection::AliDisplacedVertexSelection(const AliDisplacedVertexSelection& o)
- : TObject(o)
+ : TObject(o),
+ fVertexZ(9999),
+ fCent(100)
{
}
//____________________________________________________________________
<< std::noboolalpha << std::endl;
#endif
}
+
//____________________________________________________________________
+Bool_t
+AliDisplacedVertexSelection::Process(const AliESDEvent* esd)
+{
+ fVertexZ = 9999; // Default vertex value
+ fCent = 100; // Default centrality value
+
+ // Some constants
+ const Float_t kZDCrefSum = -66.5;
+ const Float_t kZDCrefDelta = -2.10;
+ const Float_t kZDCsigmaSum = 3.25;
+ const Float_t kZDCsigmaDelta = 2.25;
+ const Float_t kZDCsigmaSumSat = 2.50;
+ const Float_t kZDCsigmaDeltaSat = 1.35;
+
+ // Corrections for magnetic fields
+ const Float_t kZEMcorrPlusPlus[21] = {0.6840,0.7879,0.8722,
+ 0.9370,0.9837,1.0137,
+ 1.0292,1.0327,1.0271,
+ 1.0152,1.0000,0.9844,
+ 0.9714,0.9634,0.9626,
+ 0.9708,0.9891,1.0181,
+ 1.0574,1.1060,1.1617};
+ const Float_t kZEMcorrMoinsMoins[21] = {0.7082,0.8012,0.8809,
+ 0.9447,0.9916,1.0220,
+ 1.0372,1.0395,1.0318,
+ 1.0174,1.0000,0.9830,
+ 0.9699,0.9635,0.9662,
+ 0.9794,1.0034,1.0371,
+ 1.0782,1.1224,1.1634};
+
+ // --- Get the ESD object ------------------------------------------
+ AliESDZDC* esdZDC = esd->GetESDZDC();
+ if (!esdZDC) {
+ AliWarning("No ZDC ESD object!");
+ return false;
+ }
+ Double_t currentL3 = esd->GetCurrentL3();
+ Double_t currentDipo = esd->GetCurrentDip();
+
+ // --- ZDC and ZEM energy signal -----------------------------------
+ Double_t zdcEn = (esdZDC->GetZDCN1Energy()+
+ esdZDC->GetZDCP1Energy()+
+ esdZDC->GetZDCN2Energy()+
+ esdZDC->GetZDCP2Energy());
+ Double_t zemEn = (esdZDC->GetZDCEMEnergy(0)+
+ esdZDC->GetZDCEMEnergy(1))/8.;
+
+ // --- Calculate DeltaT and sumT -----------------------------------
+ Double_t deltaTdc = 0;
+ Double_t sumTdc = 0;
+
+ for(Int_t i = 0; i < 4; ++i) {
+ if(esdZDC->GetZDCTDCData(10,i) != 0) {
+ Double_t tdcCnoCorr = 0.025*(esdZDC->GetZDCTDCData(10,i)-
+ esdZDC->GetZDCTDCData(14,i));
+ Double_t tdcC = esdZDC->GetZDCTDCCorrected(10,i);
+ for(Int_t j = 0; j < 4; ++j) {
+ if(esdZDC->GetZDCTDCData(12,j) != 0) {
+ Double_t tdcAnoCorr = 0.025*(esdZDC->GetZDCTDCData(12,j)-
+ esdZDC->GetZDCTDCData(14,j));
+ Double_t tdcA = esdZDC->GetZDCTDCCorrected(12,j);
+ if(esdZDC->TestBit(AliESDZDC::kCorrectedTDCFilled)) {
+ deltaTdc = tdcC-tdcA;
+ sumTdc = tdcC+tdcA;
+ }
+ else {
+ deltaTdc = tdcCnoCorr-tdcAnoCorr;
+ sumTdc = tdcCnoCorr+tdcAnoCorr;
+ }
+ }
+ }
+ }
+ }
+
+ // --- Find the vertex ---------------------------------------------
+ if(deltaTdc!=0. || sumTdc!=0.) {
+ for (Int_t k = -10; k <= 10; ++k) {
+ Float_t zsat = 2.55F * k;
+ Float_t delta = (k == 0 ? kZDCsigmaDelta : kZDCsigmaDeltaSat);
+ Float_t sum = (k == 0 ? kZDCsigmaSum : kZDCsigmaSumSat);
+ Float_t dT = deltaTdc - kZDCrefDelta - zsat;
+ Float_t sT = sumTdc - kZDCrefSum - zsat;
+ Float_t check = dT * dT / delta / delta + sT * sT / sum / sum;
+ if (check > 1.0 || k == 0) continue;
+
+ // Set the vertex
+ fVertexZ = 37.5 * k;
+
+ // Correct zem energy
+ if(currentDipo>0 && currentL3>0) zemEn /= kZEMcorrPlusPlus[k+10];
+ if(currentDipo<0 && currentL3<0) zemEn /= kZEMcorrMoinsMoins[k+10];
+ }
+ }
+
+ // --- Calculate the centrality ------------------------------------
+ Float_t c1, c2, c3, c4, c5;
+ Int_t runnumber = esd->GetRunNumber();
+ if (runnumber < 137722 && runnumber >= 137161 ) {
+ c1 = 16992;
+ c2 = 345;
+ c3 = 2.23902e+02;
+ c4 = 1.56667;
+ c5 = 9.49434e-05;
+ }
+ else if (runnumber < 139172 && runnumber >= 137722) {
+ c1 = 15000;
+ c2 = 295;
+ c3 = 2.23660e+02;
+ c4 = 1.56664;
+ c5 = 8.99571e-05;
+ }
+ else if (runnumber >= 139172) {
+ c1 = 16992;
+ c2 = 345;
+ c3 = 2.04789e+02;
+ c4 = 1.56629;
+ c5 = 1.02768e-04;
+ }
+ else {
+ c1 = 16992;
+ c2 = 345;
+ c3 = 2.04789e+02;
+ c4 = 1.56629;
+ c5 = 1.02768e-04;
+ }
+
+ if (zemEn > c2) {
+ Float_t slope = (zdcEn + c1) / (zemEn - c2) + c3;
+ Float_t zdcCent = (TMath::ATan(slope) - c4) / c5;
+ if (zdcCent >= 0) fCent = zdcCent;
+ }
+ return true;
+}
+
+//____________________________________________________________________
Double_t
AliDisplacedVertexSelection::CheckDisplacedVertex(const AliESDEvent* esd) const {
// Code taken directly from M.Guilbaud.
+ AliWarning("This method is deprecated");
Double_t zvtx = 9999.;
Float_t kZDCrefSum =-66.5;
//Double_t fzemEn = (esdZDC->GetZDCEMEnergy(0)+esdZDC->GetZDCEMEnergy(1))/8.;
-///////////////////
-//Event Selection//
-///////////////////
- Double_t deltaTdc = 0;
- Double_t sumTdc = 0;
+
+ ///////////////////
+ //Event Selection//
+ ///////////////////
+ Double_t deltaTdc = 0;
+ Double_t sumTdc = 0;
-for(Int_t i = 0; i < 4; ++i)
- {
- if(esdZDC->GetZDCTDCData(10,i) != 0)
- {
- Double_t tdcCnoCorr = 0.025*(esdZDC->GetZDCTDCData(10,i)-esdZDC->GetZDCTDCData(14,i));
- Double_t tdcC = esdZDC->GetZDCTDCCorrected(10,i);
- for(Int_t j = 0; j < 4; ++j)
- {
- if(esdZDC->GetZDCTDCData(12,j) != 0)
- {
- Double_t tdcAnoCorr = 0.025*(esdZDC->GetZDCTDCData(12,j)-esdZDC->GetZDCTDCData(14,j));
- Double_t tdcA = esdZDC->GetZDCTDCCorrected(12,j);
- if(esdZDC->TestBit(AliESDZDC::kCorrectedTDCFilled))
- {
- deltaTdc = tdcC-tdcA;
- sumTdc = tdcC+tdcA;
- }
- else
- {
- deltaTdc = tdcCnoCorr-tdcAnoCorr;
- sumTdc = tdcCnoCorr+tdcAnoCorr;
- }
- }
- }
- }
- }
-//if(TMath::Abs(deltaTdc) > 0)
-//std::cout<<deltaTdc<<" "<<sumTdc<<std::endl;
-///////////////////////
-//Global Event Filter//
-///////////////////////
- Bool_t zdcAccSat[21];
- // Bool_t zdcAccSatRunClass[21];
- for(Int_t k = -10; k <= 10; k++)
- {
- zdcAccSat[k+10] = kFALSE;
- // zdcAccSatRunClass[k+10] = kFALSE;
- }
+ for(Int_t i = 0; i < 4; ++i) {
+ if(esdZDC->GetZDCTDCData(10,i) != 0) {
+ Double_t tdcCnoCorr = 0.025*(esdZDC->GetZDCTDCData(10,i)-
+ esdZDC->GetZDCTDCData(14,i));
+ Double_t tdcC = esdZDC->GetZDCTDCCorrected(10,i);
+ for(Int_t j = 0; j < 4; ++j) {
+ if(esdZDC->GetZDCTDCData(12,j) != 0) {
+ Double_t tdcAnoCorr = 0.025*(esdZDC->GetZDCTDCData(12,j)-
+ esdZDC->GetZDCTDCData(14,j));
+ Double_t tdcA = esdZDC->GetZDCTDCCorrected(12,j);
+ if(esdZDC->TestBit(AliESDZDC::kCorrectedTDCFilled)) {
+ deltaTdc = tdcC-tdcA;
+ sumTdc = tdcC+tdcA;
+ }
+ else {
+ deltaTdc = tdcCnoCorr-tdcAnoCorr;
+ sumTdc = tdcCnoCorr+tdcAnoCorr;
+ }
+ }
+ }
+ }
+ }
+ ///////////////////////
+ //Global Event Filter//
+ ///////////////////////
+ Bool_t zdcAccSat[21];
-if(deltaTdc!=0. || sumTdc!=0.)
- {
+ // Bool_t zdcAccSatRunClass[21];
+ for(Int_t k = -10; k <= 10; k++) zdcAccSat[k+10] = kFALSE;
- for(Int_t k = -10; k <= 10; ++k)
- {
- Float_t zsat = 2.55*(Float_t)k;
+
+ if(deltaTdc!=0. || sumTdc!=0.) {
+ for (Int_t k = -10; k <= 10; ++k) {
+ Float_t zsat = 2.55F * k;
- if(k==0)
- {
- if(((deltaTdc-kZDCrefDelta)*(deltaTdc-kZDCrefDelta)/(kZDCsigmaDelta*kZDCsigmaDelta)+
- (sumTdc -kZDCrefSum )*(sumTdc -kZDCrefSum )/(kZDCsigmaSum *kZDCsigmaSum))<=1.0)
- {
- zdcAccSat[k+10] = kTRUE;
- }
- }
- else
- {
- if(((deltaTdc-kZDCrefDelta-zsat)*(deltaTdc-kZDCrefDelta-zsat)/(kZDCsigmaDeltaSat*kZDCsigmaDeltaSat)+
- (sumTdc -kZDCrefSum -zsat)*(sumTdc -kZDCrefSum -zsat)/(kZDCsigmaSumSat *kZDCsigmaSumSat ))<=1.0)
- {
- zdcAccSat[k+10] = kTRUE;
- }
-
- }
-
- }
+ if(k==0) {
+ if(((deltaTdc-kZDCrefDelta)*(deltaTdc-kZDCrefDelta)/
+ (kZDCsigmaDelta*kZDCsigmaDelta)+
+ (sumTdc -kZDCrefSum ) * (sumTdc -kZDCrefSum ) /
+ (kZDCsigmaSum *kZDCsigmaSum))<=1.0) {
+ zdcAccSat[k+10] = kTRUE;
+ }
+ }
+ else {
+ if(((deltaTdc-kZDCrefDelta-zsat)*(deltaTdc-kZDCrefDelta-zsat)/
+ (kZDCsigmaDeltaSat*kZDCsigmaDeltaSat)+
+ (sumTdc -kZDCrefSum -zsat)*(sumTdc -kZDCrefSum -zsat)/
+ (kZDCsigmaSumSat *kZDCsigmaSumSat ))<=1.0) {
+ zdcAccSat[k+10] = kTRUE;
+ }
+ }
+ }
}
- for(Int_t k=-10;k<=10;++k) {
- if(zdcAccSat[k+10] && k!=0 ) {
- //std::cout<<"Displaced vertex at "<<37.5*(Float_t)k<<" cm"<<std::endl;
- zvtx = 37.5*(Float_t)k;
- }
- }
+ for(Int_t k=-10;k<=10;++k) {
+ if(zdcAccSat[k+10] && k!=0 ) {
+ //std::cout<<"Displaced vertex at "<<37.5*(Float_t)k<<" cm"<<std::endl;
+ zvtx = 37.5*(Float_t)k;
+ }
+ }
- return zvtx;
+ return zvtx;
}
//____________________________________________________________________
Double_t fcurrentDipo = esd->GetCurrentDip();
Double_t cent = -1;
- /*Double_t zdcNCEnergy = esdZDC->GetZDCN1Energy();
- Double_t fZpcEnergy = esdZDC->GetZDCP1Energy();
- Double_t fZnaEnergy = esdZDC->GetZDCN2Energy();
- Double_t fZpaEnergy = esdZDC->GetZDCP2Energy();
- Double_t fZem1Energy = esdZDC->GetZDCEMEnergy(0);
- Double_t fZem2Energy = esdZDC->GetZDCEMEnergy(1);*/
-
- Double_t fzdcEn = (esdZDC->GetZDCN1Energy()+esdZDC->GetZDCP1Energy()+esdZDC->GetZDCN2Energy()+esdZDC->GetZDCP2Energy());
- Double_t fzemEn = (esdZDC->GetZDCEMEnergy(0)+esdZDC->GetZDCEMEnergy(1))/8.;
+ Double_t fzdcEn = (esdZDC->GetZDCN1Energy()+
+ esdZDC->GetZDCP1Energy()+
+ esdZDC->GetZDCN2Energy()+
+ esdZDC->GetZDCP2Energy());
+ Double_t fzemEn = (esdZDC->GetZDCEMEnergy(0)+
+ esdZDC->GetZDCEMEnergy(1))/8.;
-///////////////////
-//Event Selection//
-///////////////////
- Double_t deltaTdc = 0;
- Double_t sumTdc = 0;
+ ///////////////////
+ //Event Selection//
+ ///////////////////
+ Double_t deltaTdc = 0;
+ Double_t sumTdc = 0;
-for(Int_t i = 0; i < 4; ++i)
- {
- if(esdZDC->GetZDCTDCData(10,i) != 0)
- {
- Double_t tdcCnoCorr = 0.025*(esdZDC->GetZDCTDCData(10,i)-esdZDC->GetZDCTDCData(14,i));
- Double_t tdcC = esdZDC->GetZDCTDCCorrected(10,i);
- for(Int_t j = 0; j < 4; ++j)
- {
- if(esdZDC->GetZDCTDCData(12,j) != 0)
- {
- Double_t tdcAnoCorr = 0.025*(esdZDC->GetZDCTDCData(12,j)-esdZDC->GetZDCTDCData(14,j));
- Double_t tdcA = esdZDC->GetZDCTDCCorrected(12,j);
- if(esdZDC->TestBit(AliESDZDC::kCorrectedTDCFilled))
- {
- deltaTdc = tdcC-tdcA;
- sumTdc = tdcC+tdcA;
- }
- else
- {
- deltaTdc = tdcCnoCorr-tdcAnoCorr;
- sumTdc = tdcCnoCorr+tdcAnoCorr;
- }
- }
- }
- }
- }
-//if(TMath::Abs(deltaTdc) > 0)
-//std::cout<<deltaTdc<<" "<<sumTdc<<std::endl;
-///////////////////////
-//Global Event Filter//
-///////////////////////
- Bool_t zdcAccSat[21];
- // Bool_t zdcAccSatRunClass[21];
-for(Int_t k = -10; k <= 10; k++)
- {
- zdcAccSat[k+10] = kFALSE;
- // zdcAccSatRunClass[k+10] = kFALSE;
- }
-
+ for(Int_t i = 0; i < 4; ++i) {
+ if(esdZDC->GetZDCTDCData(10,i) != 0) {
+ Double_t tdcCnoCorr = 0.025*(esdZDC->GetZDCTDCData(10,i)-
+ esdZDC->GetZDCTDCData(14,i));
+ Double_t tdcC = esdZDC->GetZDCTDCCorrected(10,i);
+ for(Int_t j = 0; j < 4; ++j) {
+ if(esdZDC->GetZDCTDCData(12,j) != 0) {
+ Double_t tdcAnoCorr = 0.025*(esdZDC->GetZDCTDCData(12,j)-
+ esdZDC->GetZDCTDCData(14,j));
+ Double_t tdcA = esdZDC->GetZDCTDCCorrected(12,j);
+ if(esdZDC->TestBit(AliESDZDC::kCorrectedTDCFilled)) {
+ deltaTdc = tdcC-tdcA;
+ sumTdc = tdcC+tdcA;
+ }
+ else {
+ deltaTdc = tdcCnoCorr-tdcAnoCorr;
+ sumTdc = tdcCnoCorr+tdcAnoCorr;
+ }
+ }
+ }
+ }
+ }
-if(deltaTdc!=0. || sumTdc!=0.)
- {
+ ///////////////////////
+ //Global Event Filter//
+ ///////////////////////
+ Bool_t zdcAccSat[21];
+ // Bool_t zdcAccSatRunClass[21];
+ for(Int_t k = -10; k <= 10; k++) zdcAccSat[k+10] = kFALSE;
- for(Int_t k = -10; k <= 10; ++k)
- {
- Float_t zsat = 2.55*(Float_t)k;
+ if(deltaTdc!=0. || sumTdc!=0.) {
+ for(Int_t k = -10; k <= 10; ++k) {
+ Float_t zsat = 2.55*(Float_t)k;
- if(k==0)
- {
- if(((deltaTdc-kZDCrefDelta)*(deltaTdc-kZDCrefDelta)/(kZDCsigmaDelta*kZDCsigmaDelta)+
- (sumTdc -kZDCrefSum )*(sumTdc -kZDCrefSum )/(kZDCsigmaSum *kZDCsigmaSum))<=1.0)
- {
- zdcAccSat[k+10] = kTRUE;
- }
- }
- else
- {
- if(((deltaTdc-kZDCrefDelta-zsat)*(deltaTdc-kZDCrefDelta-zsat)/(kZDCsigmaDeltaSat*kZDCsigmaDeltaSat)+
- (sumTdc -kZDCrefSum -zsat)*(sumTdc -kZDCrefSum -zsat)/(kZDCsigmaSumSat *kZDCsigmaSumSat ))<=1.0)
- {
- zdcAccSat[k+10] = kTRUE;
- }
-
- }
-
- }
+ if(k==0) {
+ if(((deltaTdc-kZDCrefDelta)*(deltaTdc-kZDCrefDelta)/
+ (kZDCsigmaDelta*kZDCsigmaDelta)+
+ (sumTdc -kZDCrefSum )*(sumTdc -kZDCrefSum )/
+ (kZDCsigmaSum *kZDCsigmaSum))<=1.0) {
+ zdcAccSat[k+10] = kTRUE;
+ }
+ }
+ else {
+ if(((deltaTdc-kZDCrefDelta-zsat)*(deltaTdc-kZDCrefDelta-zsat)/
+ (kZDCsigmaDeltaSat*kZDCsigmaDeltaSat)+
+ (sumTdc -kZDCrefSum -zsat)*(sumTdc -kZDCrefSum -zsat)/
+ (kZDCsigmaSumSat *kZDCsigmaSumSat ))<=1.0) {
+ zdcAccSat[k+10] = kTRUE;
+ }
+
+ }
+
+ }
}
- Float_t kZEMcorrPlusPlus[21] = {0.6840,0.7879,0.8722,0.9370,0.9837,1.0137,
- 1.0292,1.0327,1.0271,1.0152,1.0000,0.9844,
- 0.9714,0.9634,0.9626,0.9708,0.9891,1.0181,
- 1.0574,1.1060,1.1617};
- Float_t kZEMcorrMoinsMoins[21] = {0.7082,0.8012,0.8809,0.9447,0.9916,1.0220,
- 1.0372,1.0395,1.0318,1.0174,1.0000,0.9830,
- 0.9699,0.9635,0.9662,0.9794,1.0034,1.0371,
- 1.0782,1.1224,1.1634};
- ///////////////////
- //ZemEn correction//
- ////////////////////
+ Float_t kZEMcorrPlusPlus[21] = {0.6840,0.7879,0.8722,0.9370,0.9837,1.0137,
+ 1.0292,1.0327,1.0271,1.0152,1.0000,0.9844,
+ 0.9714,0.9634,0.9626,0.9708,0.9891,1.0181,
+ 1.0574,1.1060,1.1617};
+ Float_t kZEMcorrMoinsMoins[21] = {0.7082,0.8012,0.8809,0.9447,0.9916,1.0220,
+ 1.0372,1.0395,1.0318,1.0174,1.0000,0.9830,
+ 0.9699,0.9635,0.9662,0.9794,1.0034,1.0371,
+ 1.0782,1.1224,1.1634};
+ ///////////////////
+ //ZemEn correction//
+ ////////////////////
- for(Int_t k = -10; k <= 10; ++k)
- {
- if(zdcAccSat[k+10])
- {
- //std::cout<<"Vertex at "<<37.5*(Float_t)k<<"cm from cent"<<std::endl;
- if(fcurrentDipo>0 && fcurrentL3>0)
- {
- fzemEn /= kZEMcorrPlusPlus[k+10];
- }
- if(fcurrentDipo<0 && fcurrentL3<0)
- {
- fzemEn /= kZEMcorrMoinsMoins[k+10];
- }
- }
- }
+ for(Int_t k = -10; k <= 10; ++k) {
+ if(zdcAccSat[k+10]) {
+ //std::cout<<"Vertex at "<<37.5*(Float_t)k<<"cm from cent"<<std::endl;
+ if(fcurrentDipo>0 && fcurrentL3>0) {
+ fzemEn /= kZEMcorrPlusPlus[k+10];
+ }
+ if(fcurrentDipo<0 && fcurrentL3<0) {
+ fzemEn /= kZEMcorrMoinsMoins[k+10];
+ }
+ }
+ }
- ////////////////////////
- //Centrality selection//
- ////////////////////////
- Double_t fzdcPercentile = -1;
- Float_t slope;
+ ////////////////////////
+ //Centrality selection//
+ ////////////////////////
+ Double_t fzdcPercentile = -1;
+ Float_t slope;
- if(runnumber < 137722 && runnumber >= 137161 )
- {
- if(fzemEn > 345.)
- {
- slope = (fzdcEn + 16992.)/(fzemEn - 345.);
- slope += 2.23902e+02;
- fzdcPercentile = (TMath::ATan(slope) - 1.56667)/9.49434e-05;
- if (fzdcPercentile<0) fzdcPercentile = 0;
- }
- else fzdcPercentile = 100; }
- else if(runnumber < 139172 && runnumber >= 137722)
- {
- if(fzemEn > 295.)
- {
- slope = (fzdcEn + 15000.)/(fzemEn - 295.);
- slope += 2.23660e+02;
- fzdcPercentile = (TMath::ATan(slope) - 1.56664)/8.99571e-05;
- if (fzdcPercentile<0) fzdcPercentile = 0;
- } else fzdcPercentile = 100; }
-
-
- else if(runnumber >= 139172)
- {
- if(fzemEn > 345.)
- {
- slope = (fzdcEn + 16992.)/(fzemEn - 345.);
- slope += 2.04789e+02;
- fzdcPercentile = (TMath::ATan(slope) - 1.56629)/1.02768e-04;
- if (fzdcPercentile<0) fzdcPercentile = 0;
- } else fzdcPercentile = 100; }
- else
- {
- if(fzemEn > 345.)
- {
- slope = (fzdcEn + 16992.)/(fzemEn - 345.);
- slope += 2.04789e+02;
- fzdcPercentile = (TMath::ATan(slope) - 1.56629)/1.02768e-04;
- if(fzdcPercentile<0) fzdcPercentile = 0;
- }
- else fzdcPercentile = 100; }
-
- if(fzdcPercentile > 0 && fzdcPercentile <100) {
- //std::cout<<fzdcPercentile<<std::endl;
- cent = fzdcPercentile;
- }
- return cent;
+ if(runnumber < 137722 && runnumber >= 137161 ) {
+ if(fzemEn > 345.) {
+ slope = (fzdcEn + 16992.)/(fzemEn - 345.);
+ slope += 2.23902e+02;
+ fzdcPercentile = (TMath::ATan(slope) - 1.56667)/9.49434e-05;
+ if (fzdcPercentile<0) fzdcPercentile = 0;
+ }
+ else fzdcPercentile = 100; }
+ else if(runnumber < 139172 && runnumber >= 137722) {
+ if(fzemEn > 295.) {
+ slope = (fzdcEn + 15000.)/(fzemEn - 295.);
+ slope += 2.23660e+02;
+ fzdcPercentile = (TMath::ATan(slope) - 1.56664)/8.99571e-05;
+ if (fzdcPercentile<0) fzdcPercentile = 0;
+ }
+ else fzdcPercentile = 100;
+ }
+ else if(runnumber >= 139172) {
+ if(fzemEn > 345.) {
+ slope = (fzdcEn + 16992.)/(fzemEn - 345.);
+ slope += 2.04789e+02;
+ fzdcPercentile = (TMath::ATan(slope) - 1.56629)/1.02768e-04;
+ if (fzdcPercentile<0) fzdcPercentile = 0;
+ }
+ else fzdcPercentile = 100;
+ }
+ else {
+ if(fzemEn > 345.) {
+ slope = (fzdcEn + 16992.)/(fzemEn - 345.);
+ slope += 2.04789e+02;
+ fzdcPercentile = (TMath::ATan(slope) - 1.56629)/1.02768e-04;
+ if(fzdcPercentile<0) fzdcPercentile = 0;
+ }
+ else fzdcPercentile = 100;
+ }
+
+ if(fzdcPercentile > 0 && fzdcPercentile <100) {
+ //std::cout<<fzdcPercentile<<std::endl;
+ cent = fzdcPercentile;
+ }
+ return cent;
}
//____________________________________________________________________
//
* @param option Not used
*/
void Print(Option_t* option="") const;
+ /**
+ * Process an ESD event to get the information
+ *
+ * @param esd ESD event
+ *
+ * @return true on success
+ */
+ Bool_t Process(const AliESDEvent* esd);
+
+ Double_t GetVertexZ() const { return fVertexZ; }
+ Double_t GetCentralityPercentile() const { return fCent; }
/**
* Check for displaced vertices (M.Guilbaud)
*
Double_t CalculateDisplacedVertexCent(const AliESDEvent* esd) const;
protected:
-
+ Double_t fVertexZ;
+ Double_t fCent;
ClassDef(AliDisplacedVertexSelection,1); // Cuts on ESD Mult
};
TList* d = new TList;
d->SetName(GetName());
dir->Add(d);
+
+ d->Add(AliForwardUtil::MakeParameter("secondary", fUseSecondaryMap));
+ d->Add(AliForwardUtil::MakeParameter("vertexBias", fUseVertexBias));
+ d->Add(AliForwardUtil::MakeParameter("acceptance", fUseAcceptance));
+ d->Add(AliForwardUtil::MakeParameter("merging", fUseMergingEfficiency));
+
+
TIter next(&fRingHistos);
RingHistos* o = 0;
while ((o = static_cast<RingHistos*>(next()))) {
#include <TProfile.h>
#include <THStack.h>
#include <TROOT.h>
-#include <TParameter.h>
#include <iostream>
#include <iomanip>
// r Ring
// iEta Eta bin
//
- DGUARD(fDebug, 3, "Find maximum weight in FMD density calculator");
+ DGUARD(fDebug, 10, "Find maximum weight in FMD density calculator");
if(!cor) return -1;
AliFMDCorrELossFit::ELossFit* fit = cor->GetFit(d,r,iEta);
// Return:
//
//
- DGUARD(fDebug, 3, "Apply correction in FMD density calculator");
+ DGUARD(fDebug, 10, "Apply correction in FMD density calculator");
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
Float_t correction = 1;
// TNamed* sigma = new TNamed("sigma",
// (fIncludeSigma ? "included" : "excluded"));
+#if 0
TNamed* maxP = new TNamed("maxParticle", Form("%d", fMaxParticles));
TNamed* method = new TNamed("method",
(fUsePoisson ? "Poisson" : "Energy loss"));
TNamed* etaL = new TNamed("etaLumping", Form("%d", fEtaLumping));
TNamed* phiL = new TNamed("phiLumping", Form("%d", fPhiLumping));
// TParameter<double>* nxi = new TParameter<double>("nXi", fNXi);
-
+#else
+ TObject* maxP = AliForwardUtil::MakeParameter("maxParticle", fMaxParticles);
+ TObject* method = AliForwardUtil::MakeParameter("method", fUsePoisson);
+ TObject* phiA = AliForwardUtil::MakeParameter("phiAcceptance",
+ fUsePhiAcceptance);
+ TObject* etaL = AliForwardUtil::MakeParameter("etaLumping", fEtaLumping);
+ TObject* phiL = AliForwardUtil::MakeParameter("phiLumping", fPhiLumping);
+#endif
// d->Add(sigma);
d->Add(maxP);
d->Add(method);
y.SetTitle("sector");
fPoisson.Define(x, y);
- TParameter<double>* cut = new TParameter<double>("cut", fMultCut);
- d->Add(cut);
+ d->Add(AliForwardUtil::MakeParameter("cut", fMultCut));
}
//____________________________________________________________________
//
// Default Constructor - do not use
//
- DGUARD(fDebug, 0, "Default CTOR of AliFMDEnergyFitter");
+ DGUARD(fDebug, 1, "Default CTOR of AliFMDEnergyFitter");
}
//____________________________________________________________________
// Parameters:
// title Title of object - not significant
//
- DGUARD(fDebug, 0, "Named CTOR of AliFMDEnergyFitter: %s", title);
+ DGUARD(fDebug, 1, "Named CTOR of AliFMDEnergyFitter: %s", title);
fEtaAxis.SetName("etaAxis");
fEtaAxis.SetTitle("#eta");
fCentralityAxis.SetName("centralityAxis");
// Parameters:
// o Object to copy from
//
- DGUARD(fDebug, 0, "Copy CTOR of AliFMDEnergyFitter");
+ DGUARD(fDebug, 1, "Copy CTOR of AliFMDEnergyFitter");
TIter next(&o.fRingHistos);
TObject* obj = 0;
while ((obj = next())) fRingHistos.Add(obj);
Int_t icent = fCentralityAxis.FindBin(cent);
if (icent < 1 || icent > fCentralityAxis.GetNbins()) icent = 0;
+ UShort_t nFills = 0;
for(UShort_t d = 1; d <= 3; d++) {
Int_t nRings = (d == 1 ? 1 : 2);
for (UShort_t q = 0; q < nRings; q++) {
if (ieta < 1 || ieta > fEtaAxis.GetNbins()) continue;
histos->Fill(empty, ieta-1, icent, mult);
-
+ nFills++;
} // for strip
} // for sector
} // for ring
} // for detector
+ DMSG(fDebug, 1, "Found a total of %d signals for c=%f, and %sempty event",
+ nFills, cent, (empty ? "" : "non-"));
return kTRUE;
}
// icent Centrality bin (1-based)
// mult Signal
//
- DGUARD(fDebug, 2, "Filling in AliFMDEnergyFitter::RingHistos");
+ DGUARD(fDebug, 10, "Filling in AliFMDEnergyFitter::RingHistos");
if (empty) {
fEmpty->Fill(mult);
return;
fHEventsAcceptedXY(0),
fHTriggers(0),
fHType(0),
- fHWords(0),
+ fHWords(0),
fHCent(0),
- fHCentVsQual(0),
+ fHCentVsQual(0),
+ fHStatus(0),
fLowFluxCut(1000),
fMaxVzErr(0.2),
fList(0),
fMinPileupContrib(3),
fMinPileupDistance(0.8),
fUseDisplacedVertices(false),
- fDisplacedVertex()
+ fDisplacedVertex(),
+ fCollWords(),
+ fBgWords()
{
//
// Constructor
//
- DGUARD(fDebug,0,"Default CTOR of AliFMDEventInspector");
+ DGUARD(fDebug,1,"Default CTOR of AliFMDEventInspector");
}
//____________________________________________________________________
fHWords(0),
fHCent(0),
fHCentVsQual(0),
+ fHStatus(0),
fLowFluxCut(1000),
fMaxVzErr(0.2),
fList(0),
fMinPileupContrib(3),
fMinPileupDistance(0.8),
fUseDisplacedVertices(false),
- fDisplacedVertex()
+ fDisplacedVertex(),
+ fCollWords(),
+ fBgWords()
{
//
// Constructor
// Parameters:
// name Name of object
//
- DGUARD(fDebug,0,"Named CTOR of AliFMDEventInspector: %s", name);
+ DGUARD(fDebug,1,"Named CTOR of AliFMDEventInspector: %s", name);
}
//____________________________________________________________________
fHWords(o.fHWords),
fHCent(o.fHCent),
fHCentVsQual(o.fHCentVsQual),
+ fHStatus(o.fHStatus),
fLowFluxCut(o.fLowFluxCut),
fMaxVzErr(o.fMaxVzErr),
fList(o.fList),
fMinPileupContrib(o.fMinPileupContrib),
fMinPileupDistance(o.fMinPileupDistance),
fUseDisplacedVertices(o.fUseDisplacedVertices),
- fDisplacedVertex(o.fDisplacedVertex)
+ fDisplacedVertex(o.fDisplacedVertex),
+ fCollWords(),
+ fBgWords()
{
//
// Copy constructor
// Parameters:
// o Object to copy from
//
- DGUARD(fDebug,0,"Copy CTOR of AliFMDEventInspector");
+ DGUARD(fDebug,1,"Copy CTOR of AliFMDEventInspector");
}
//____________________________________________________________________
fHWords = o.fHWords;
fHCent = o.fHCent;
fHCentVsQual = o.fHCentVsQual;
+ fHStatus = o.fHStatus;
fLowFluxCut = o.fLowFluxCut;
fMaxVzErr = o.fMaxVzErr;
fDebug = o.fDebug;
if (fHWords) fList->Add(fHWords);
if (fHCent) fList->Add(fHCent);
if (fHCentVsQual) fList->Add(fHCentVsQual);
+ if (fHStatus) fList->Add(fHStatus);
}
return *this;
}
if (!hEventsTr || !hEventsTrVtx || !hTriggers) return kFALSE;
return kTRUE;
}
+//____________________________________________________________________
+void
+AliFMDEventInspector::CacheConfiguredTriggerClasses(TList& cache,
+ const TList* classes,
+ AliOADBPhysicsSelection* o)
+{
+ TIter nextClass(classes);
+ TObjString* trigClass = 0;
+ // Loop over all trigger classes. Trigger classes have the format
+ //
+ // class := positive_words SPACE(s) negative_words
+ // positive_words :=
+ // | '+' words
+ // negative_words :=
+ // | '-' words
+ // words := word
+ // | word ',' words
+ //
+ while ((trigClass = static_cast<TObjString*>(nextClass()))) {
+ // Tokenize on space to get positive and negative parts
+ TString side = o->GetBeamSide(trigClass->String());
+ TObjArray* parts = trigClass->String().Tokenize(" ");
+ TObjString* part = 0;
+ TIter nextPart(parts);
+ while ((part = static_cast<TObjString*>(nextPart()))) {
+ // We only care about the positive ones
+ if (part->GetName()[0] != '+') continue;
+ part->String().Remove(0,1);
+
+ // Tokenize on a comma to get the words
+ TObjArray* words = part->String().Tokenize(",");
+ TObjString* word = 0;
+ TIter nextWord(words);
+ while ((word = static_cast<TObjString*>(nextWord()))) {
+ TNamed* store = new TNamed(word->String(), side);
+ cache.Add(store);
+ DMSG(fDebug,3,"Caching %s trigger word %s",
+ store->GetTitle(), store->GetName());
+ } // while (word)
+ delete words;
+ }
+ delete parts;
+ }
+}
+
//____________________________________________________________________
void
AliFMDEventInspector::Init(const TAxis& vtxAxis)
{
//
- // Initialize the object
+ // Initialize the object - this is called on the first seen event.
//
// Parameters:
// vtxAxis Vertex axis in use
//
DGUARD(fDebug,1,"Initialize in AliFMDEventInspector");
+
+ AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
+
+ // Get the input handler - should always be there
+ AliInputEventHandler* ih =
+ static_cast<AliInputEventHandler*>(am->GetInputEventHandler());
+ if (!ih) {
+ AliWarning("No input handler");
+ return;
+ }
+ // Get the physics selection - should always be there
+ AliPhysicsSelection* ps =
+ static_cast<AliPhysicsSelection*>(ih->GetEventSelection());
+ if (!ps) {
+ AliWarning("No physics selection");
+ return;
+ }
+ // Get the configured triggers
+ AliOADBPhysicsSelection* oadb =
+ const_cast<AliOADBPhysicsSelection*>(ps->GetOADBPhysicsSelection());
+ if (!oadb) {
+ AliWarning("No OADB physics selection object");
+ return;
+ }
+ // Get the configured trigger words from the physics selection
+ const TList* collTriggClasses = ps->GetCollisionTriggerClasses();
+ const TList* bgTriggClasses = ps->GetBGTriggerClasses();
+ if (!collTriggClasses) {
+ AliWarning("No configured collision trigger classes");
+ return;
+ }
+ if (!bgTriggClasses) {
+ AliWarning("No configured background trigger classes");
+ return;
+ }
+ CacheConfiguredTriggerClasses(fCollWords, collTriggClasses, oadb);
+ CacheConfiguredTriggerClasses(fBgWords, bgTriggClasses, oadb);
+ // fCollWords.ls();
+ // fBgWords.ls();
+
// -1.5 -0.5 0.5 1.5 ... 89.5 ... 100.5
// ----- 92 number --------- ---- 1 ---
fHCentVsQual->GetXaxis()->SetBinLabel(4, "V0 vs TPC outlier");
fHCentVsQual->GetXaxis()->SetBinLabel(5, "V0 vs ZDC outlier");
fList->Add(fHCentVsQual);
+
+ fHStatus = new TH1I("status", "Status", 7, 1, 8);
+ fHStatus->SetFillColor(kRed+1);
+ fHStatus->SetFillStyle(3001);
+ fHStatus->SetStats(0);
+ fHStatus->SetDirectory(0);
+ fHStatus->GetXaxis()->SetBinLabel(1, "OK");
+ fHStatus->GetXaxis()->SetBinLabel(2, "No event");
+ fHStatus->GetXaxis()->SetBinLabel(3, "No triggers");
+ fHStatus->GetXaxis()->SetBinLabel(4, "No SPD");
+ fHStatus->GetXaxis()->SetBinLabel(5, "No FMD");
+ fHStatus->GetXaxis()->SetBinLabel(6, "No vertex");
+ fHStatus->GetXaxis()->SetBinLabel(7, "Bad vertex");
+ fList->Add(fHStatus);
}
//____________________________________________________________________
DGUARD(fDebug,2,"Store information from AliFMDEventInspector");
if (!fList) return;
-#if 0
- TNamed* sys = new TNamed("sys", "");
- TNamed* sNN = new TNamed("sNN", "");
- TNamed* fld = new TNamed("field", "");
- TNamed* run = new TNamed("runNo", Form("%d", runNo));
- TNamed* low = new TNamed("lowFlux", Form("%d", fLowFluxCut));
- TNamed* fpv = new TNamed("fpVtx", Form("%s", fUseFirstPhysicsVertex ?
- "true" : "false"));
- TNamed* v0a = new TNamed("v0and", Form("%s", fUseV0AND ? "true" : "false"));
- TNamed* nCp = new TNamed("nPileup", Form("%d", fMinPileupContrib));
- sys->SetTitle(AliForwardUtil::CollisionSystemString(fCollisionSystem));
- sNN->SetTitle(AliForwardUtil::CenterOfMassEnergyString(fEnergy));
- fld->SetTitle(AliForwardUtil::MagneticFieldString(fField));
-#else
- TParameter<int>* sys = new TParameter<int>("sys", fCollisionSystem);
- TParameter<int>* sNN = new TParameter<int>("sNN", fEnergy);
- TParameter<int>* fld = new TParameter<int>("field", fField);
- TParameter<int>* run = new TParameter<int>("runNo", runNo);
- TParameter<int>* low = new TParameter<int>("lowFlux", fLowFluxCut);
- TParameter<bool>* fpv = new TParameter<bool>("fpVtx",fUseFirstPhysicsVertex);
- TParameter<bool>* v0a = new TParameter<bool>("v0and",fUseV0AND);
- TParameter<int>* nCp = new TParameter<int>("nPileUp", fMinPileupContrib);
- TParameter<Double_t>* dP = new TParameter<Double_t>("dPileup",
- fMinPileupDistance);
-#endif
- sys->SetUniqueID(fCollisionSystem);
- sNN->SetUniqueID(fEnergy);
- fld->SetUniqueID(fField);
- run->SetUniqueID(runNo);
- low->SetUniqueID(fLowFluxCut);
- fpv->SetUniqueID(fUseFirstPhysicsVertex ? 1 : 0);
- v0a->SetUniqueID(fUseV0AND ? 1 : 0);
- nCp->SetUniqueID(fMinPileupContrib);
-
- fList->Add(sys);
- fList->Add(sNN);
- fList->Add(fld);
- fList->Add(run);
- fList->Add(low);
- fList->Add(fpv);
- fList->Add(v0a);
- fList->Add(nCp);
- fList->Add(dP);
+
+ fList->Add(AliForwardUtil::MakeParameter("sys", fCollisionSystem));
+ fList->Add(AliForwardUtil::MakeParameter("sNN", fEnergy));
+ fList->Add(AliForwardUtil::MakeParameter("field", fField));
+ fList->Add(AliForwardUtil::MakeParameter("runNo", runNo));
+ fList->Add(AliForwardUtil::MakeParameter("lowFlux", fLowFluxCut));
+ fList->Add(AliForwardUtil::MakeParameter("fpVtx",fUseFirstPhysicsVertex));
+ fList->Add(AliForwardUtil::MakeParameter("v0and",fUseV0AND));
+ fList->Add(AliForwardUtil::MakeParameter("nPileUp", fMinPileupContrib));
+ fList->Add(AliForwardUtil::MakeParameter("dPileup", fMinPileupDistance));
}
//____________________________________________________________________
// --- Check that we have an event ---------------------------------
if (!event) {
AliWarning("No ESD event found for input event");
+ fHStatus->Fill(2);
return kNoEvent;
}
// --- Read trigger information from the ESD and store in AOD object
- if (!ReadTriggers(event, triggers, nClusters)) {
+ if (!ReadTriggers(*event, triggers, nClusters)) {
if (fDebug > 2) {
AliWarning("Failed to read triggers from ESD"); }
+ fHStatus->Fill(3);
return kNoTriggers;
}
lowFlux = testmult->GetNumberOfTracklets() < fLowFluxCut;
fHType->Fill(lowFlux ? 0 : 1);
+
+ // --- Process satellite event information is requested ------------
+ if (fUseDisplacedVertices) {
+ if (!fDisplacedVertex.Process(event))
+ AliWarning("Failed to process satellite event");
+ }
// --- Read centrality information
cent = -10;
UShort_t qual = 0;
- if (!ReadCentrality(event, cent, qual)) {
+ if (!ReadCentrality(*event, cent, qual)) {
if (fDebug > 3)
AliWarning("Failed to get centrality");
}
}
// --- Get the vertex information ----------------------------------
-
Double_t vx = 0;
Double_t vy = 0;
vz = 0;
- Bool_t vzOk = ReadVertex(event, vz,vx,vy);
+ Bool_t vzOk = ReadVertex(*event, vz,vx,vy);
fHEventsTr->Fill(vz);
if (!vzOk) {
if (fDebug > 3) {
AliWarning("Failed to read vertex from ESD"); }
+ fHStatus->Fill(6);
return kNoVertex;
}
fHEventsTrVtx->Fill(vz);
vz, fVtxAxis.GetXmin(), fVtxAxis.GetXmax()));
}
ivz = 0;
+ fHStatus->Fill(7);
return kBadVertex;
}
fHEventsAccepted->Fill(vz);
if (!event->GetFMDData()) {
if (fDebug > 3) {
AliWarning("No FMD data found in ESD"); }
+ fHStatus->Fill(5);
return kNoFMD;
}
-
+ fHStatus->Fill(1);
return kOk;
}
//____________________________________________________________________
Bool_t
-AliFMDEventInspector::ReadCentrality(const AliESDEvent* esd,
+AliFMDEventInspector::ReadCentrality(const AliESDEvent& esd,
Double_t& cent,
UShort_t& qual) const
{
// False on error, true otherwise
//
DGUARD(fDebug,2,"Read the centrality in AliFMDEventInspector");
-
- cent = -1;
- qual = 0;
- AliCentrality* centObj = const_cast<AliESDEvent*>(esd)->GetCentrality();
- if (!centObj) return true;
-AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
- Bool_t isMC = am->GetMCtruthEventHandler() != 0;
-
- //std::cout<<fUseDisplacedVertices<<" "<<isMC<<std::endl;
- if(fUseDisplacedVertices && !isMC) {
- Double_t zvtx = fDisplacedVertex.CheckDisplacedVertex(esd);
+
+ if(fUseDisplacedVertices) {
+ Double_t zvtx = fDisplacedVertex.GetVertexZ();
qual = 1;
if(TMath::Abs(zvtx) < 999) {
- cent = fDisplacedVertex.CalculateDisplacedVertexCent(esd); //centObj->GetCentralityPercentileUnchecked("ZEMvsZDC");
+ cent = fDisplacedVertex.GetCentralityPercentile();
qual = 0;
}
- }
- else if(fUseDisplacedVertices && isMC) {
-
-
- AliMCEventHandler* mchandler = static_cast<AliMCEventHandler*>(am->GetMCtruthEventHandler());
- AliMCEvent* mcevent = mchandler->MCEvent();
-
- AliHeader* header = mcevent->Header();
- AliGenEventHeader* genHeader = header->GenEventHeader();
- AliCollisionGeometry* colGeometry =
- dynamic_cast<AliCollisionGeometry*>(genHeader);
- Double_t b = -1;
- if (colGeometry)
- b = colGeometry->ImpactParameter();
- std::cout<<"Hallo!! "<<b<<std::endl;
- cent = -1;
- if(b<3.5 && b >0) cent = 2.5; //0-5%
- if(b>3.5 && b<4.95) cent = 7.5; //5-10%
- if(b>4.95 && b<6.98) cent = 15; //10-20%
- if(b>6.98 && b<8.55) cent = 25; //20-30%
- if(b>8.55 && b<9.88) cent = 35; //30-40%
- if(b>9.88 && b<11.04) cent = 45; //40-50%
- if(b>11.04) cent = 55; //50-60%
- //cent = 10;
- qual = 0;
- }
- else {
- cent = centObj->GetCentralityPercentile("V0M");
- qual = centObj->GetQuality();
+ return true;
}
- // AliInfo(Form("Got centrality object %p with quality %d",
- // centObj, centObj->GetQuality()));
- // centObj->Print();
- //cent = centObj->GetCentralityPercentile("V0M");
- //cent = centObj->GetCentralityPercentile("ZEMvsZDC");
- //qual = centObj->GetQuality();
+ cent = -1;
+ qual = 0;
+ AliCentrality* centObj = const_cast<AliESDEvent&>(esd).GetCentrality();
+ if (!centObj) return true;
+
+ cent = centObj->GetCentralityPercentile("V0M");
+ qual = centObj->GetQuality();
return true;
}
//____________________________________________________________________
Bool_t
-AliFMDEventInspector::ReadTriggers(const AliESDEvent* esd, UInt_t& triggers,
+AliFMDEventInspector::ReadTriggers(const AliESDEvent& esd, UInt_t& triggers,
UShort_t& nClusters)
{
//
// Get the analysis manager - should always be there
AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
+ DMSG(fDebug,10,"Got analysis manager %p", am);
if (!am) {
AliWarning("No analysis manager defined!");
return kFALSE;
// Get the input handler - should always be there
AliInputEventHandler* ih =
static_cast<AliInputEventHandler*>(am->GetInputEventHandler());
+ DMSG(fDebug,10,"Got input handler %p", ih);
if (!ih) {
AliWarning("No input handler");
return kFALSE;
}
- AliPhysicsSelection* ps =
- static_cast<AliPhysicsSelection*>(ih->GetEventSelection());
- if (!ps) {
- AliWarning("No physics selection");
- return kFALSE;
- }
- AliOADBPhysicsSelection* oadb =
- const_cast<AliOADBPhysicsSelection*>(ps->GetOADBPhysicsSelection());
- if (!oadb) {
- AliWarning("No OADB physics selection object");
- return kFALSE;
- }
// Check if this is a collision candidate (MB)
// Note, that we should use the value cached in the input
// on the AliPhysicsSelection obejct. If we called the latter
// then the AliPhysicsSelection object would overcount by a
// factor of 2! :-(
- Bool_t offline = ih->IsEventSelected() ;
- Bool_t fastonly = (ih->IsEventSelected() & AliVEvent::kFastOnly);
- TString trigStr = esd->GetFiredTriggerClasses();
+ Bool_t offline = ih->IsEventSelected() ;
+ Bool_t fastonly = (ih->IsEventSelected() & AliVEvent::kFastOnly);
+ TString trigStr = esd.GetFiredTriggerClasses();
+
+ if (fHWords) fHWords->Fill(trigStr.Data(), 1);
- //If we have the MC input handler, this must be MC
- Bool_t isMC = am->GetMCtruthEventHandler() != 0;
+ if(fUseDisplacedVertices) {
+ DMSG(fDebug,3,"Using displaced vertex stuff");
+ if (TMath::Abs(fDisplacedVertex.GetVertexZ()) >= 999) offline = false;
+ }
- if(fUseDisplacedVertices && isMC) {
- AliMCEventHandler* mchandler = static_cast<AliMCEventHandler*>(am->GetMCtruthEventHandler());
- AliMCEvent* mcevent = mchandler->MCEvent();
- AliHeader* header = mcevent->Header();
- AliGenEventHeader* genHeader = header->GenEventHeader();
- TArrayF vertex;
- genHeader->PrimaryVertex(vertex);
+ if (CheckFastPartition(fastonly)) offline = false;
+ if (offline && CheckCosmics(trigStr)) offline = false;
+
+ DMSG(fDebug,2,"Event is %striggered by off-line", offline ? "" : "NOT ");
+
+ if (offline) {
+ triggers |= AliAODForwardMult::kOffline;
+ triggers |= AliAODForwardMult::kInel;
+ if (!fHTriggers) {
+ AliWarning("Histogram of triggers not defined - has init been called");
+ return false;
+ }
+ fHTriggers->Fill(kOffline+0.5);
- Double_t zvtx = vertex.At(2);
- if(TMath::Abs(zvtx) > 35)
- offline = true;
- else offline = false;
+ CheckINELGT0(esd, nClusters, triggers);
}
- if(fUseDisplacedVertices && !isMC) {
- Double_t zvtx = fDisplacedVertex.CheckDisplacedVertex(esd);
- if(TMath::Abs(zvtx) < 999) offline = true;
- else offline = false;
+ CheckNSD(esd,triggers);
+ if (CheckPileup(esd, triggers)) fHTriggers->Fill(kPileUp+.5);
+ if (CheckEmpty(trigStr, triggers)) fHTriggers->Fill(kEmpty+.5);
+
+ CheckWords(esd, triggers);
+
+ // Now check - if we have a collision - for offline triggers and
+ // fill histogram.
+ if (triggers & AliAODForwardMult::kB) {
+ fHTriggers->Fill(kB+.5);
+ if (triggers & AliAODForwardMult::kInel)
+ fHTriggers->Fill(kInel);
+
+ if (triggers & AliAODForwardMult::kInelGt0)
+ fHTriggers->Fill(kInelGt0+.5);
+ if (triggers & AliAODForwardMult::kNSD)
+ fHTriggers->Fill(kNSD+.5);
+
+ if (triggers & AliAODForwardMult::kV0AND)
+ fHTriggers->Fill(kV0AND+.5);
}
+ if (triggers & AliAODForwardMult::kA) fHTriggers->Fill(kA+.5);
+ if (triggers & AliAODForwardMult::kC) fHTriggers->Fill(kC+.5);
+ if (triggers & AliAODForwardMult::kE) fHTriggers->Fill(kE+.5);
+
+ return kTRUE;
+}
+
+//____________________________________________________________________
+Bool_t
+AliFMDEventInspector::CheckFastPartition(bool fastonly) const
+{
// For the 2.76 TeV p+p run, the FMD ran in the slow partition
// so it received no triggers from the fast partition. Therefore
// the fast triggers are removed here but not for MC where all
// triggers are fast.
- if(TMath::Abs(fEnergy - 2750.) < 20 &&
- fCollisionSystem == AliForwardUtil::kPP &&
- !isMC)
- if (fastonly) offline = false;
+ if (TMath::Abs(fEnergy - 2750.) > 20) return false;
+ if (fCollisionSystem != AliForwardUtil::kPP) return false;
+ if (fastonly)
+ DMSG(fDebug,1,"Fast trigger in pp @ sqrt(s)=2.76TeV removed");
+
+ return fastonly;
+}
+
+//____________________________________________________________________
+Bool_t
+AliFMDEventInspector::CheckCosmics(const TString& trigStr) const
+{
+ // MUON triggers are not strictly minimum bias (MB) so they are
+ // removed (HHD)
+ if(trigStr.Contains("CMUS1")) {
+ DMSG(fDebug,1,"Cosmic trigger ins't min-bias, removed");
+ return true;
+ }
+ return false;
+}
+
+//____________________________________________________________________
+Bool_t
+AliFMDEventInspector::CheckINELGT0(const AliESDEvent& esd,
+ UShort_t& nClusters,
+ UInt_t& triggers) const
+{
nClusters = 0;
-
- // MUON triggers are not strictly minimum bias (MB) so they are removed (HHD)
-
- if(offline && trigStr.Contains("CMUS1")) offline = false;
-
- if (offline) {
- triggers |= AliAODForwardMult::kOffline;
- triggers |= AliAODForwardMult::kInel;
- if (!fHTriggers) {
- AliWarning("Histogram of triggers not defined - has init been called");
- return false;
- }
- fHTriggers->Fill(kOffline+0.5);
- // If this is inel, see if we have a tracklet
- const AliMultiplicity* spdmult = esd->GetMultiplicity();
- if (!spdmult) {
- AliWarning("No SPD multiplicity");
- }
- else {
- // Check if we have one or more tracklets
- // in the range -1 < eta < 1 to set the INEL>0
- // trigger flag.
- //
- // Also count tracklets as a single cluster
- Int_t n = spdmult->GetNumberOfTracklets();
- for (Int_t j = 0; j < n; j++) {
- if(TMath::Abs(spdmult->GetEta(j)) < 1) {
- triggers |= AliAODForwardMult::kInelGt0;
- nClusters++;
- }
- }
- n = spdmult->GetNumberOfSingleClusters();
- for (Int_t j = 0; j < n; j++) {
- Double_t eta = -TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.));
- if (TMath::Abs(eta) < 1) nClusters++;
- }
+ // If this is inel, see if we have a tracklet
+ const AliMultiplicity* spdmult = esd.GetMultiplicity();
+ if (!spdmult) {
+ AliWarning("No SPD multiplicity");
+ return false;
+ }
+
+ // Check if we have one or more tracklets
+ // in the range -1 < eta < 1 to set the INEL>0
+ // trigger flag.
+ //
+ // Also count tracklets as a single cluster
+ Int_t n = spdmult->GetNumberOfTracklets();
+ for (Int_t j = 0; j < n; j++) {
+ if(TMath::Abs(spdmult->GetEta(j)) < 1) {
+ triggers |= AliAODForwardMult::kInelGt0;
+ nClusters++;
}
- if (nClusters > 0) triggers |= AliAODForwardMult::kNClusterGt0;
}
-
+ n = spdmult->GetNumberOfSingleClusters();
+ for (Int_t j = 0; j < n; j++) {
+ Double_t eta = -TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.));
+ if (TMath::Abs(eta) < 1) nClusters++;
+ }
+ if (nClusters > 0) triggers |= AliAODForwardMult::kNClusterGt0;
+
+ return triggers & AliAODForwardMult::kNClusterGt0;
+}
+
+//____________________________________________________________________
+Bool_t
+AliFMDEventInspector::CheckNSD(const AliESDEvent& esd, UInt_t& triggers) const
+{
// Analyse some trigger stuff
AliTriggerAnalysis ta;
- if (ta.IsOfflineTriggerFired(esd, AliTriggerAnalysis::kV0AND)) {
+ if (ta.IsOfflineTriggerFired(&esd, AliTriggerAnalysis::kV0AND)) {
triggers |= AliAODForwardMult::kV0AND;
if (fUseV0AND)
triggers |= AliAODForwardMult::kNSD;
}
- if (ta.IsOfflineTriggerFired(esd, AliTriggerAnalysis::kNSD1))
+ if (ta.IsOfflineTriggerFired(&esd, AliTriggerAnalysis::kNSD1))
triggers |= AliAODForwardMult::kNSD;
-
+ return triggers & AliAODForwardMult::kNSD;
+}
+//____________________________________________________________________
+Bool_t
+AliFMDEventInspector::CheckPileup(const AliESDEvent& esd,
+ UInt_t& triggers) const
+{
// Check for multiple vertices (pile-up) with at least 3
// contributors and at least 0.8cm from the primary vertex
- Bool_t pileup = kFALSE;
- if(fCollisionSystem == AliForwardUtil::kPP)
- pileup = esd->IsPileupFromSPD(fMinPileupContrib,fMinPileupDistance);
- if (pileup) {
- triggers |= AliAODForwardMult::kPileUp;
- fHTriggers->Fill(kPileUp+.5);
- }
-
- // Get trigger stuff
-
- //TString trigStr = esd->GetFiredTriggerClasses();
- // AliWarning(Form("Fired trigger classes: %s", trigStr.Data()));
- if (fHWords) fHWords->Fill(trigStr.Data(), 1);
-#if 0
- if (trigStr.Contains("MB1") || trigStr.Contains("MBBG3"))
- triggers |= AliAOODForwardMult::kB;
- if (trigStr.Contains("COTA"))
- triggers |= AliAODForwardMult::kA;
- if (trigStr.Contains("COTC"))
- triggers |= AliAODForwardMult::kC;
-#endif
+ if(fCollisionSystem != AliForwardUtil::kPP) return false;
+
+ Bool_t pileup = esd.IsPileupFromSPD(fMinPileupContrib,fMinPileupDistance);
+ if (pileup) triggers |= AliAODForwardMult::kPileUp;
+ return pileup;
+}
+
+//____________________________________________________________________
+Bool_t
+AliFMDEventInspector::CheckEmpty(const TString& trigStr, UInt_t& triggers) const
+{
if (trigStr.Contains("CBEAMB-ABCE-NOPF-ALL")) {
triggers |= AliAODForwardMult::kEmpty;
- fHTriggers->Fill(kEmpty+.5);
- }
-#if 0
- // Check for B triggers
- if (trigStr.Contains("CINT1B-ABCE-NOPF-ALL") || // Early pp
- trigStr.Contains("CINT1-B-NOPF-ALLNOTRD") || // Late pp
- trigStr.Contains("CINT1-B-NOPF-FASTNOTRD") || // Late pp
- //trigStr.Contains("CMUS1-B-NOPF-MUON") || // Late pp -- HHD 160811
- trigStr.Contains("CSMBB-ABCE-NOPF-ALL") || // pp
- trigStr.Contains("CMBACS2-B-NOPF-ALL") || // PbPb
- // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
- trigStr.Contains("CMBS2A-B-NOPF-ALL") || // PbPb
- trigStr.Contains("CMBS2C-B-NOPF-ALL") || // PbPb
- trigStr.Contains("CMBAC-B-NOPF-ALL") || // PbPb
- // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
- trigStr.Contains("CMBACS2-B-NOPF-ALLNOTRD") // PbPb
- // trigStr.Contains("C0SMH-B-NOPF-ALLNOTRD") // PbPb - high mult
- ) {
- Bool_t bTrigger = kTRUE;
- if ( trigStr.Contains("CINT1-B-NOPF-FASTNOTRD") &&
- !trigStr.Contains("CINT1-B-NOPF-ALLNOTRD") &&
- TMath::Abs(fEnergy - 2750.) < 20 &&
- fCollisionSystem == AliForwardUtil::kPP)
- bTrigger = kFALSE;
- if(bTrigger) {
- triggers |= AliAODForwardMult::kB;
- fHTriggers->Fill(kB+.5);
- }
- }
-
- // Check for A triggers
- if (trigStr.Contains("CINT1A-ABCE-NOPF-ALL") || // Early pp
- trigStr.Contains("CINT1-AC-NOPF-ALLNOTRD") || // Late pp
- trigStr.Contains("CINT1-AC-NOPF-FASTNOTRD") || // Late pp
- (trigStr.Contains("CSMBA-ABCE-NOPF-ALL") &&
- !(triggers & AliAODForwardMult::kB)) || // pp
- trigStr.Contains("CMBACS2-A-NOPF-ALL") || // PbPb
- // trigStr.Contains("C0SMH-A-NOPF-ALL") || // PbPb - high mult
- trigStr.Contains("CMBS2A-A-NOPF-ALL") || // PbPb
- trigStr.Contains("CMBS2C-A-NOPF-ALL") || // PbPb
- trigStr.Contains("CMBAC-A-NOPF-ALL") || // PbPb
- // trigStr.Contains("C0SMH-A-NOPF-ALL") || // PbPb - high mult
- trigStr.Contains("CMBACS2-A-NOPF-ALLNOTRD") // PbPb
- // trigStr.Contains("C0SMH-A-NOPF-ALLNOTRD") // PbPb - high mult
- ) {
- triggers |= AliAODForwardMult::kA;
- fHTriggers->Fill(kA+.5);
- }
-
- // Check for C triggers
- if (trigStr.Contains("CINT1C-ABCE-NOPF-ALL") || // Early pp
- (trigStr.Contains("CSMBC-ABCE-NOPF-ALL") &&
- !(triggers & AliAODForwardMult::kB)) || // pp
- trigStr.Contains("CMBACS2-C-NOPF-ALL") || // PbPb
- // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
- trigStr.Contains("CMBS2A-C-NOPF-ALL") || // PbPb
- trigStr.Contains("CMBS2C-C-NOPF-ALL") || // PbPb
- trigStr.Contains("CMBAC-C-NOPF-ALL") || // PbPb
- // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
- trigStr.Contains("CMBACS2-C-NOPF-ALLNOTRD") // PbPb
- // trigStr.Contains("C0SMH-B-NOPF-ALLNOTRD") // PbPb - high mult
- ) {
- triggers |= AliAODForwardMult::kC;
- fHTriggers->Fill(kC+.5);
+ return true;
}
+ return false;
+}
+//____________________________________________________________________
+Bool_t
+AliFMDEventInspector::CheckWords(const AliESDEvent& esd, UInt_t& triggers) const
+{
+ TObject* word = 0;
+ TIter nextColl(&fCollWords);
+ while ((word = nextColl())) {
+ DMSG(fDebug,10,"Checking if %s trigger %s is fired",
+ word->GetTitle(), word->GetName());
+ if (!esd.IsTriggerClassFired(word->GetName())) continue;
- // Check for E triggers
- if (trigStr.Contains("CINT1-E-NOPF-ALL") || // Early pp
- trigStr.Contains("CINT1-E-NOPF-ALLNOTRD") || // Late pp
- trigStr.Contains("CINT1-E-NOPF-FASTNOTRD") || // Late pp
- trigStr.Contains("CMBACS2-E-NOPF-ALL") || // PbPb
- // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
- trigStr.Contains("CMBS2A-E-NOPF-ALL") || // PbPb
- trigStr.Contains("CMBS2C-E-NOPF-ALL") || // PbPb
- trigStr.Contains("CMBAC-E-NOPF-ALL") || // PbPb
- // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
- trigStr.Contains("CMBACS2-E-NOPF-ALLNOTRD") // PbPb
- // trigStr.Contains("C0SMH-B-NOPF-ALLNOTRD") // PbPb - high mult
- ) {
- triggers |= AliAODForwardMult::kE;
- fHTriggers->Fill(kE+.5);
- }
-#endif
+ TString beamSide = word->GetTitle();
+ DMSG(fDebug,10,"Found it - this is a %s trigger", beamSide.Data());
- const TList* collTriggClasses = ps->GetCollisionTriggerClasses();
- const TList* bgTriggClasses = ps->GetBGTriggerClasses();
-
- TIter nextColl(collTriggClasses);
- TObjString* oadbString = 0;
- TObjArray* tokens = 0;
- while ((oadbString = static_cast<TObjString*>(nextColl()))) {
- tokens = oadbString->String().Tokenize(" ");
- for (Int_t i = 0; i < tokens->GetEntries(); i++) {
- TString string = (((TObjString*)tokens->At(i))->String());
- if (string[0] != '+') continue;
- string.Remove(0,1);
- if (trigStr.Contains(string.Data())) {
- TString beamSide = oadb->GetBeamSide(oadbString->String().Data());
- if (beamSide.EqualTo("B")) {
- triggers |= AliAODForwardMult::kB;
- fHTriggers->Fill(kB+.5);
- }
- }
- }
- }
- TIter nextBG(bgTriggClasses);
- while ((oadbString = static_cast<TObjString*>(nextBG()))) {
- tokens = oadbString->String().Tokenize(" ");
- for (Int_t i = 0; i < tokens->GetEntries(); i++) {
- TString string = (((TObjString*)tokens->At(i))->String());
- if (string[0] != '+') continue;
- string.Remove(0,1);
- if (trigStr.Contains(string.Data())) {
- TString beamSide = oadb->GetBeamSide(oadbString->String().Data());
- if (beamSide.Contains("A")) {
- triggers |= AliAODForwardMult::kA;
- fHTriggers->Fill(kA+.5);
- }
- if (beamSide.Contains("C")) {
- triggers |= AliAODForwardMult::kC;
- fHTriggers->Fill(kC+.5);
- }
- if (beamSide.Contains("E")) {
- triggers |= AliAODForwardMult::kE;
- fHTriggers->Fill(kE+.5);
- }
- }
- }
+ if (!beamSide.EqualTo("B")) continue;
+ triggers |= AliAODForwardMult::kB;
+ break; // No more to do here
}
-
- // Now check - if we have a collision - for offline triggers and
- // fill histogram.
- if (triggers & AliAODForwardMult::kB) {
- if (triggers & AliAODForwardMult::kInel)
- fHTriggers->Fill(kInel);
-
- if (triggers & AliAODForwardMult::kInelGt0)
- fHTriggers->Fill(kInelGt0+.5);
+ TIter nextBg(&fBgWords);
+ UInt_t all = (AliAODForwardMult::kA |
+ AliAODForwardMult::kC |
+ AliAODForwardMult::kE);
+ while ((word = nextBg())) {
+ DMSG(fDebug,10,"Checking if %s trigger %s is fired",
+ word->GetTitle(), word->GetName());
+ if (!esd.IsTriggerClassFired(word->GetName())) continue;
- if (triggers & AliAODForwardMult::kNSD)
- fHTriggers->Fill(kNSD+.5);
+ TString beamSide = word->GetTitle();
+ DMSG(fDebug,10,"Found it - this is a %s trigger", beamSide.Data());
- if (triggers & AliAODForwardMult::kV0AND)
- fHTriggers->Fill(kV0AND+.5);
+ if (beamSide.Contains("A")) triggers |= AliAODForwardMult::kA;
+ if (beamSide.Contains("C")) triggers |= AliAODForwardMult::kC;
+ if (beamSide.Contains("E")) triggers |= AliAODForwardMult::kE;
+
+ if ((triggers & all) == all) break; // No more to do
}
-
- return kTRUE;
+ return true;
}
+
+
//____________________________________________________________________
Bool_t
-AliFMDEventInspector::ReadVertex(const AliESDEvent* esd,
+AliFMDEventInspector::ReadVertex(const AliESDEvent& esd,
Double_t& vz,
Double_t& vx,
Double_t& vy)
vx = 1024;
vy = 1024;
- AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
- Bool_t isMC = am->GetMCtruthEventHandler() != 0;
- if(fUseDisplacedVertices && isMC) {
-
- AliMCEventHandler* mchandler = static_cast<AliMCEventHandler*>(am->GetMCtruthEventHandler());
- AliMCEvent* mcevent = mchandler->MCEvent();
- AliHeader* header = mcevent->Header();
- AliGenEventHeader* genHeader = header->GenEventHeader();
- TArrayF vertex;
- genHeader->PrimaryVertex(vertex);
-
- Double_t zvtx = vertex.At(2);
- Double_t ratio = zvtx/37.5;
- if(ratio > 0) ratio = ratio + 0.5;
- if(ratio < 0) ratio = ratio - 0.5;
- Int_t ratioInt = (Int_t)ratio;
- zvtx = 37.5*((Double_t)ratioInt);
- if(TMath::Abs(zvtx) < 999) {
- vz = zvtx;
- return true;
- }
- else return false;
-
- }
- if(fUseDisplacedVertices && !isMC) {
- Double_t zvtx = fDisplacedVertex.CheckDisplacedVertex(esd);
-
+ if(fUseDisplacedVertices) {
+ Double_t zvtx = fDisplacedVertex.GetVertexZ();
+
if(TMath::Abs(zvtx) < 999) {
vz = zvtx;
return true;
}
- else return false;
+ return false;
}
- if(fUseFirstPhysicsVertex) {
- // This is the code used by the 1st physics people
- const AliESDVertex* vertex = esd->GetPrimaryVertex();
- if (!vertex || !vertex->GetStatus()) {
- if (fDebug > 2) {
- AliWarning(Form("No primary vertex (%p) or bad status %d",
- vertex, (vertex ? vertex->GetStatus() : -1)));
- }
- return false;
- }
- const AliESDVertex* vertexSPD = esd->GetPrimaryVertexSPD();
- if (!vertexSPD || !vertexSPD->GetStatus()) {
- if (fDebug > 2) {
- AliWarning(Form("No primary SPD vertex (%p) or bad status %d",
- vertexSPD, (vertexSPD ? vertexSPD->GetStatus() : -1)));
- }
- return false;
- }
-
- // if vertex is from SPD vertexZ, require more stringent cuts
- if (vertex->IsFromVertexerZ()) {
- if (vertex->GetDispersion() > fMaxVzErr ||
- vertex->GetZRes() > 1.25 * fMaxVzErr) {
- if (fDebug > 2) {
- AliWarning(Form("Dispersion %f > %f or resolution %f > %f",
- vertex->GetDispersion(), fMaxVzErr,
- vertex->GetZRes(), 1.25 * fMaxVzErr));
- }
- return false;
- }
- }
- vz = vertex->GetZ();
+ if(fUseFirstPhysicsVertex) return CheckPWGUDVertex(esd, vz, vx, vy);
+
+
+ return CheckVertex(esd, vz, vx, vy);
+}
+
+//____________________________________________________________________
+Bool_t
+AliFMDEventInspector::CheckPWGUDVertex(const AliESDEvent& esd,
+ Double_t& vz,
+ Double_t& vx,
+ Double_t& vy) const
+{
+ // This is the code used by the 1st physics people
+ const AliESDVertex* vertex = esd.GetPrimaryVertex();
+ if (!vertex || !vertex->GetStatus()) {
+ DMSG(fDebug,2,"No primary vertex (%p) or bad status %d",
+ vertex, (vertex ? vertex->GetStatus() : -1));
+ return false;
+ }
+ const AliESDVertex* vertexSPD = esd.GetPrimaryVertexSPD();
+ if (!vertexSPD || !vertexSPD->GetStatus()) {
+ DMSG(fDebug,2,"No primary SPD vertex (%p) or bad status %d",
+ vertexSPD, (vertexSPD ? vertexSPD->GetStatus() : -1));
+ return false;
+ }
- if(!vertex->IsFromVertexerZ()) {
- vx = vertex->GetX();
- vy = vertex->GetY();
+ // if vertex is from SPD vertexZ, require more stringent cuts
+ if (vertex->IsFromVertexerZ()) {
+ if (vertex->GetDispersion() > fMaxVzErr ||
+ vertex->GetZRes() > 1.25 * fMaxVzErr) {
+ DMSG(fDebug,2,"Dispersion %f > %f or resolution %f > %f",
+ vertex->GetDispersion(), fMaxVzErr,
+ vertex->GetZRes(), 1.25 * fMaxVzErr);
+ return false;
}
- return true;
}
- else { //Use standard SPD vertex (perhaps preferable for Pb+Pb)
-
- // Get the vertex
- const AliESDVertex* vertex = esd->GetPrimaryVertexSPD();
- if (!vertex) {
- if (fDebug > 2) {
- AliWarning("No SPD vertex found in ESD"); }
- return kFALSE;
- }
+ vz = vertex->GetZ();
+
+ if(!vertex->IsFromVertexerZ()) {
+ vx = vertex->GetX();
+ vy = vertex->GetY();
+ }
+ return true;
+}
+//____________________________________________________________________
+Bool_t
+AliFMDEventInspector::CheckVertex(const AliESDEvent& esd,
+ Double_t& vz,
+ Double_t& vx,
+ Double_t& vy) const
+{
+ // Use standard SPD vertex (perhaps preferable for Pb+Pb)
+ // Get the vertex
+ const AliESDVertex* vertex = esd.GetPrimaryVertexSPD();
+ if (!vertex) {
+ if (fDebug > 2) {
+ AliWarning("No SPD vertex found in ESD"); }
+ return false;
+ }
- // Check that enough tracklets contributed
- if(vertex->GetNContributors() <= 0) {
- if (fDebug > 2) {
- AliWarning(Form("Number of contributors to vertex is %d<=0",
- vertex->GetNContributors())); }
- vz = 0;
- return kFALSE;
- }
- // Check that the uncertainty isn't too large
- if (vertex->GetZRes() > fMaxVzErr) {
- if (fDebug > 2) {
- AliWarning(Form("Uncertaintity in Z of vertex is too large %f > %f",
- vertex->GetZRes(), fMaxVzErr)); }
- return kFALSE;
- }
+ // Check that enough tracklets contributed
+ if(vertex->GetNContributors() <= 0) {
+ DMSG(fDebug,2,"Number of contributors to vertex is %d<=0",
+ vertex->GetNContributors());
+ vz = 0;
+ return false;
+ }
+ // Check that the uncertainty isn't too large
+ if (vertex->GetZRes() > fMaxVzErr) {
+ DMSG(fDebug,2,"Uncertaintity in Z of vertex is too large %f > %f",
+ vertex->GetZRes(), fMaxVzErr);
+ return false;
+ }
- // Get the z coordiante
- vz = vertex->GetZ();
- const AliESDVertex* vertexXY = esd->GetPrimaryVertex();
+ // Get the z coordiante
+ vz = vertex->GetZ();
+ const AliESDVertex* vertexXY = esd.GetPrimaryVertex();
- if(!vertexXY->IsFromVertexerZ()) {
- vx = vertexXY->GetX();
- vy = vertexXY->GetY();
- }
- return kTRUE;
- }
+ if(!vertexXY->IsFromVertexerZ()) {
+ vx = vertexXY->GetX();
+ vy = vertexXY->GetY();
+ }
+ return true;
}
-
+
//____________________________________________________________________
Bool_t
AliFMDEventInspector::ReadRunDetails(const AliESDEvent* esd)
return kTRUE;
}
+
+//____________________________________________________________________
+const Char_t*
+AliFMDEventInspector::CodeString(UInt_t code)
+{
+ static TString s;
+ s = "";
+ if (code & kNoEvent) s.Append("NOEVENT ");
+ if (code & kNoTriggers) s.Append("NOTRIGGERS ");
+ if (code & kNoSPD) s.Append("NOSPD ");
+ if (code & kNoFMD) s.Append("NOFMD ");
+ if (code & kNoVertex) s.Append("NOVERTEX ");
+ if (code & kBadVertex) s.Append("BADVERTEX ");
+ return s.Data();
+}
//____________________________________________________________________
void
AliFMDEventInspector::Print(Option_t*) const
field.ReplaceAll("m", "-");
field.ReplaceAll("kG", " kG");
- std::cout << ind << ClassName() << ": " << GetName() << '\n'
+ std::cout << std::boolalpha
+ << ind << ClassName() << ": " << GetName() << '\n'
<< ind << " Vertex bins: " << fVtxAxis.GetNbins() << '\n'
<< ind << " Vertex range: [" << fVtxAxis.GetXmin()
<< "," << fVtxAxis.GetXmax() << "]\n"
<< ind << " System: "
<< AliForwardUtil::CollisionSystemString(fCollisionSystem) << '\n'
<< ind << " CMS energy per nucleon: " << sNN << '\n'
- << ind << " Field: " << field << '\n';
+ << ind << " Field: " << field << '\n'
+ << ind << " Satellite events: " << fUseDisplacedVertices
+ << "\n" << std::noboolalpha;
if (!fCentAxis) { std::cout << std::flush; return; }
Int_t nBin = fCentAxis->GetNbins();
std::cout << ind << " Centrality axis: " << nBin << " bins"
*/
#include <TNamed.h>
#include <TAxis.h>
+#include <TList.h>
#include "AliDisplacedVertexSelection.h"
class AliESDEvent;
+class AliOADBPhysicsSelection;
class TH2D;
class TH1D;
class TH1I;
class TH1F;
class TH2F;
class TAxis;
-class TList;
+// class TList;
/**
* This class inspects the event
* Return codes
*/
enum ECodes {
- /** all ok */
+ /** all ok - bin 1 */
kOk = 0,
- /** No ESD event */
+ /** No ESD event - bin 2 */
kNoEvent = 0x1,
- /** No triggers found */
+ /** No triggers found - bin 3 */
kNoTriggers = 0x2,
- /** No SPD data */
+ /** No SPD data - bin 4 */
kNoSPD = 0x4,
- /** No FMD data */
+ /** No FMD data - bin 5 */
kNoFMD = 0x8,
- /** No vertex found */
+ /** No vertex found - bin 6 */
kNoVertex = 0x10,
- /** Vertex out of range */
+ /** Vertex out of range - bin 7 */
kBadVertex = 0x20
};
/**
* @param runNo Run number - read off from ESD event
*/
virtual void StoreInformation(Int_t runNo);
+ /**
+ * Return a string representing the return code
+ *
+ * @param mask Code
+ *
+ * @return String representation
+ */
+ static const char* CodeString(UInt_t mask);
protected:
+ /**
+ * Cache the configure trigger classes from the physis selection.
+ *
+ * @param cache where to cache the trigger class.
+ * @param classes List of configured classes.
+ * @param o Object from OADB with config
+ */
+ void CacheConfiguredTriggerClasses(TList& cache,
+ const TList* classes,
+ AliOADBPhysicsSelection* o);
/**
* Read the trigger information from the ESD event
*
*
* @return @c true on success, @c false otherwise
*/
- Bool_t ReadTriggers(const AliESDEvent* esd, UInt_t& triggers,
+ Bool_t ReadTriggers(const AliESDEvent& esd, UInt_t& triggers,
UShort_t& nClusters);
+ /**
+ * Check, for the @f$\sqrt{s}=2.76GeV@f$ pp run wether this event
+ * was in the fast partition, and if so, filter it out.
+ *
+ * @param fastonly Event was in fast-only partition
+ *
+ * @return true if event was in the fast-only partition, for the run
+ * period.
+ */
+ virtual Bool_t CheckFastPartition(bool fastonly) const;
+ /**
+ * Check if we have an NSD trigger for pp runs
+ *
+ * @param esd Data
+ * @param triggers Trigger mask to be filled
+ *
+ * @return true if we have an NSD trigger
+ */
+ virtual Bool_t CheckNSD(const AliESDEvent& esd, UInt_t& triggers) const;
+ /**
+ * Check if we have an INEL>0 trigger
+ *
+ * @param esd Data
+ * @param nClusters On return, number of clusters
+ * @param triggers Trigger mask to be filled
+ *
+ * @return true if we have an INEL>0 trigger
+ */
+ virtual Bool_t CheckINELGT0(const AliESDEvent& esd, UShort_t& nClusters,
+ UInt_t& triggers) const;
+ /**
+ * Check if this is a pile-up event
+ *
+ * @param esd Data
+ * @param triggers Trigger mask to be filled
+ *
+ * @return true if this is a pile-up event
+ */
+ virtual Bool_t CheckPileup(const AliESDEvent& esd, UInt_t& triggers) const;
+ /**
+ * Check if we have a cosmic trigger. These should be filtered out.
+ *
+ * @param trigStri Trigger string
+ *
+ * @return true if we have a cosmic trigger
+ */
+ virtual Bool_t CheckCosmics(const TString& trigStri) const;
+ /**
+ * Check if the trigger string corresponds to an empty event
+ *
+ * @param trigStr Trigger string
+ * @param triggers Trigger mask to be filled
+ *
+ * @return true if the trigger string corresponds to an empty event
+ */
+ virtual Bool_t CheckEmpty(const TString& trigStr, UInt_t& triggers) const;
+ /**
+ * Check the trigger words to see if we have a B, A, C, or E event.
+ *
+ * @param esd Data
+ * @param triggers Trigger mask to be filled
+ *
+ * @return always true
+ */
+ virtual Bool_t CheckWords(const AliESDEvent& esd, UInt_t& triggers) const;
/**
* Read the vertex information from the ESD event
*
*
* @return @c true on success, @c false otherwise
*/
- Bool_t ReadVertex(const AliESDEvent* esd,
+ Bool_t ReadVertex(const AliESDEvent& esd,
Double_t& vz,
Double_t& vx,
Double_t& vy);
+ /**
+ * Check the vertex using the method used in PWG-UD. That is
+ *
+ * - Check we have a vertex and status is OK
+ * - Check if we have an SPD vertex and that it's status is OK
+ * - Check if the vertex is from the Z-vertexer, and if it is,
+ * - Check that the dispersion and resolution is OK
+ *
+ * @param esd Data
+ * @param vz On return, the Z coordinate of the IP
+ * @param vx On return, possibly the X coordinate of the IP
+ * @param vy On return, possibly the Y coordinate of the IP
+ *
+ * @return true if the vertex was found and met the requirements
+ */
+ virtual Bool_t CheckPWGUDVertex(const AliESDEvent& esd,
+ Double_t& vz,
+ Double_t& vx,
+ Double_t& vy) const;
+ /**
+ * Check the vertex. That is
+ *
+ * - Check if we have an SPD vertex and that it's status is OK
+ * - Check that we have enough contributors
+ * - Check that the reslution is OK
+ *
+ * @param esd Data
+ * @param vz On return, the Z coordinate of the IP
+ * @param vx On return, possibly the X coordinate of the IP
+ * @param vy On return, possibly the Y coordinate of the IP
+ *
+ * @return true if the vertex was found and met the requirements
+ */
+ virtual Bool_t CheckVertex(const AliESDEvent& esd,
+ Double_t& vz,
+ Double_t& vx,
+ Double_t& vy) const;
/**
* Read centrality from event
*
*
* @return False on error, true otherwise
*/
- virtual Bool_t ReadCentrality(const AliESDEvent* esd, Double_t& cent,
- UShort_t& qual) const;
+ Bool_t ReadCentrality(const AliESDEvent& esd, Double_t& cent,
+ UShort_t& qual) const;
TH1I* fHEventsTr; //! Histogram of events w/trigger
TH1I* fHEventsTrVtx; //! Events w/trigger and vertex
TH1I* fHWords; //! Trigger words
TH1F* fHCent; //! Centrality
TH2F* fHCentVsQual; //! Centrality vs quality
+ TH1I* fHStatus; //! Event processing status
Int_t fLowFluxCut; // Low flux cut
Double_t fMaxVzErr; // Maximum error on v_z
TList* fList; //! Histogram container
// vertex
Bool_t fUseDisplacedVertices; //Analyze displaced vertices?
AliDisplacedVertexSelection fDisplacedVertex; //Displaced vertex selector
+ TList fCollWords; //! Configured collision words
+ TList fBgWords; //! Configured background words
ClassDef(AliFMDEventInspector,4); // Inspect the event
};
UShort_t& ivz,
Double_t& vz,
Double_t& b,
+ Double_t& c,
Int_t& npart,
Int_t& nbin,
Double_t& phiR)
// means outside of the defined vertex range
// vz On return, the z position of the interaction
// b On return, the impact parameter - < 0 if not available
+ // c On return, centrality estimate - < 0 if not available
// phiR On return, the event plane angle - < 0 if not available
//
// Return:
npart = 0;
nbin = 0;
b = -1;
+ c = -1;
if (colGeometry) {
b = colGeometry->ImpactParameter();
phi = colGeometry->ReactionPlaneAngle();
npart = 2; // Always 2 protons
nbin = 1; // Always 1 binary collision
}
+ if (b >= 0) {
+ if (b < 3.5) c = 2.5; //0-5%
+ else if (b < 4.95) c = 7.5; //5-10%
+ else if (b < 6.98) c = 15; //10-20%
+ else if (b < 8.55) c = 25; //20-30%
+ else if (b < 9.88) c = 35; //30-40%
+ else if (b < 11.04) c = 45; //40-50%
+ else c = 55; //50-60%
+ }
if(dpmHeader) { // Also an AliCollisionGeometry
Int_t processType = dpmHeader->ProcessType();
// 1 & 4 are ND
fHBvsPart->Fill(b, npart);
fHBvsBin->Fill(b, nbin);
+ if(fUseDisplacedVertices) {
+ // Put the vertex at fixed locations
+ Double_t zvtx = vz;
+ Double_t ratio = zvtx/37.5;
+ if(ratio > 0) ratio = ratio + 0.5;
+ if(ratio < 0) ratio = ratio - 0.5;
+ Int_t ratioInt = Int_t(ratio);
+ zvtx = 37.5*((Double_t)ratioInt);
+ if(TMath::Abs(zvtx) > 999)
+ return kBadVertex;
+ }
+
// Check for the vertex bin
ivz = fVtxAxis.FindBin(vz);
if (ivz <= 0 || ivz > fHEventsTr->GetXaxis()->GetNbins()) {
return false;
}
-//____________________________________________________________________
-Bool_t
-AliFMDMCEventInspector::ReadCentrality(const AliESDEvent* esd,
- Double_t& cent,
- UShort_t& qual) const
-{
- //
- // Read centrality from event
- //
- // Parameters:
- // esd Event
- // cent On return, the centrality or negative if not found
- //
- // Return:
- // False on error, true otherwise
- //
- cent = -1;
- qual = 0;
- AliCentrality* centObj = const_cast<AliESDEvent*>(esd)->GetCentrality();
- if (!centObj) return true;
-AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
- Bool_t isMC = am->GetMCtruthEventHandler() != 0;
-
- //std::cout<<fUseDisplacedVertices<<" "<<isMC<<std::endl;
-
- if(fUseDisplacedVertices && isMC) {
-
-
- AliMCEventHandler* mchandler = static_cast<AliMCEventHandler*>(am->GetMCtruthEventHandler());
- AliMCEvent* mcevent = mchandler->MCEvent();
-
- AliHeader* header = mcevent->Header();
- AliGenEventHeader* genHeader = header->GenEventHeader();
- AliCollisionGeometry* colGeometry =
- dynamic_cast<AliCollisionGeometry*>(genHeader);
- Double_t b = -1;
- if (colGeometry)
- b = colGeometry->ImpactParameter();
- //std::cout<<"Hallo!! "<<b<<std::endl;
- cent = -1;
- if(b<3.5 && b >0) cent = 2.5; //0-5%
- if(b>3.5 && b<4.95) cent = 7.5; //5-10%
- if(b>4.95 && b<6.98) cent = 15; //10-20%
- if(b>6.98 && b<8.55) cent = 25; //20-30%
- if(b>8.55 && b<9.88) cent = 35; //30-40%
- if(b>9.88 && b<11.04) cent = 45; //40-50%
- if(b>11.04) cent = 55; //50-60%
- //cent = 10;
- qual = 0;
- }
- else {
-
- qual = centObj->GetQuality();
- if (qual == 0x8) // Ignore ZDC outliers
- cent = centObj->GetCentralityPercentileUnchecked("V0M");
- else
- cent = centObj->GetCentralityPercentile("V0M");
- }
- return true;
-}
//____________________________________________________________________
Bool_t
* means outside of the defined vertex range
* @param vz On return, the z position of the interaction
* @param b On return, impact parameter [fm] (if available)
+ * @param b On return, centrality estimate [%] (if available)
* @param npart On return, number of participants (if available)
* @param nbin On return, number of binary collisions (if available)
* @param phiR On return, reaction plane angle (if available)
UShort_t& ivz,
Double_t& vz,
Double_t& b,
+ Double_t& c,
Int_t& npart,
Int_t& nbin,
Double_t& phiR);
*/
virtual void ReadProductionDetails(AliMCEvent* event);
protected:
- /**
- * Read centrality from event
- *
- * @param esd Event
- * @param cent On return, the centrality or negative if not found
- * @param qual Quality flag
- *
- * @return False on error, true otherwise
- */
- virtual Bool_t ReadCentrality(const AliESDEvent* esd, Double_t& cent,
- UShort_t& qual) const;
/**
* Check if the event is single diffractive
*
Bool_t IsSingleDiffractive(AliStack* stack,
Double_t xiMin=0,
Double_t xiMax=1./81) const;
+ virtual Bool_t CheckFastPartition(bool) const { return false; }
+
TH1F* fHVertex; // Histogram of vertex
TH1F* fHPhiR; // Histogram of event plane
TH1F* fHB; // Histogram of impact parameter
#include "AliFMDMultCuts.h"
#include "AliForwardCorrectionManager.h"
#include "AliFMDCorrELossFit.h"
+#include "AliForwardUtil.h"
#include <iostream>
#include <TROOT.h>
#include <TParameter.h>
l->Add(ll);
}
- TParameter<double>* nXi = new TParameter<double>("nXi", fNXi);
- TParameter<double>* frac = new TParameter<double>("frac", fMPVFraction);
- TNamed* sigma = new TNamed("sigma", fIncludeSigma ?
- "included" : "excluded");
- sigma->SetUniqueID(fIncludeSigma);
- ll->Add(nXi);
- ll->Add(frac);
- ll->Add(sigma);
+ ll->Add(AliForwardUtil::MakeParameter("nXi", fNXi));
+ ll->Add(AliForwardUtil::MakeParameter("frac", fMPVFraction));
+ ll->Add(AliForwardUtil::MakeParameter("sigma", fIncludeSigma));
+}
+//____________________________________________________________________
+Bool_t
+AliFMDMultCuts::Input(TList* l, const char* name)
+{
+ if (!l) return false;
+ TList* ll = l;
+ if (name && name[0] != '\0') {
+ ll = static_cast<TList*>(l->FindObject(name));
+ }
+ if (!ll) return false;
+
+ TObject* nXi = ll->FindObject("nXi");
+ TObject* frac = ll->FindObject("frac");
+ TObject* sigma = ll->FindObject("sigma");
+ if (!nXi || !frac || !sigma) return false;
+ AliForwardUtil::GetParameter(nXi, fNXi);
+ AliForwardUtil::GetParameter(frac, fMPVFraction);
+ AliForwardUtil::GetParameter(sigma, fIncludeSigma);
+
+ return true;
}
//____________________________________________________________________
* @param name Name
*/
void Output(TList* l, const char* name=0) const;
+ /**
+ * Read in cuts stored in file
+ *
+ * @param l List to read from
+ * @param name Name of possible sub-list
+ *
+ * @return true on success
+ */
+ Bool_t Input(TList* l, const char* name);
/**
* Get a fixed cut value
*
//
// Default Constructor - do not use
//
- DGUARD(fDebug,0, "Default CTOR for AliFMDSharingFilter");
+ DGUARD(fDebug,1, "Default CTOR for AliFMDSharingFilter");
}
//____________________________________________________________________
// Parameters:
// title Title of object - not significant
//
- DGUARD(fDebug,0, "Named CTOR for AliFMDSharingFilter: %s", title);
+ DGUARD(fDebug,1, "Named CTOR for AliFMDSharingFilter: %s", title);
fRingHistos.SetName(GetName());
fRingHistos.SetOwner();
// Parameters:
// o Object to copy from
//
- DGUARD(fDebug,0, "Copy CTOR for AliFMDSharingFilter");
+ DGUARD(fDebug,1, "Copy CTOR for AliFMDSharingFilter");
TIter next(&o.fRingHistos);
TObject* obj = 0;
while ((obj = next())) fRingHistos.Add(obj);
}
//____________________________________________________________________
+#define ETA2COS(ETA) \
+ TMath::Cos(2*TMath::ATan(TMath::Exp(-TMath::Abs(ETA))))
+
Bool_t
AliFMDSharingFilter::Filter(const AliESDFMD& input,
Bool_t lowFlux,
Int_t nCandidate = 0;
Int_t nMerged = 0;
Int_t nSummed = 0;
+ Int_t nSingle = 0;
+ Int_t nDouble = 0;
+ Int_t nTriple = 0;
Status status[512];
Bool_t usedPrev = kFALSE;
#endif
//For simple merging
- Bool_t used = kFALSE;
- Double_t eTotal = -1;
+ Bool_t used = kFALSE;
+ Double_t eTotal = -1;
Int_t nDistanceBefore = -1;
Int_t nDistanceAfter = -1;
Bool_t twoLow = kFALSE;
nDistanceAfter++;
output.SetMultiplicity(d,r,s,t,0.);
- Float_t mult = SignalInStrip(input,d,r,s,t);
- //For simple merging
- Float_t multNext = 0;
- Float_t multNextNext = 0;
-
- if(t<nstr-1) multNext = SignalInStrip(input,d,r,s,t+1);
- if(t<nstr-2) multNextNext = SignalInStrip(input,d,r,s,t+2);
- if(multNext == AliESDFMD::kInvalidMult) multNext = 0;
- if(multNextNext == AliESDFMD::kInvalidMult) multNextNext = 0;
+ Float_t mult = SignalInStrip(input,d,r,s,t);
+ Float_t multNext = (t<nstr-1) ? SignalInStrip(input,d,r,s,t+1) :0;
+ Float_t multNextNext = (t<nstr-2) ? SignalInStrip(input,d,r,s,t+2) :0;
+ if (multNext == AliESDFMD::kInvalidMult) multNext = 0;
+ if (multNextNext == AliESDFMD::kInvalidMult) multNextNext = 0;
if(!fThreeStripSharing) multNextNext = 0;
+
// Get the pseudo-rapidity
Double_t eta = input.Eta(d,r,s,t);
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;
+ Double_t etaOld = eta;
+ Double_t etaCalc = AliForwardUtil::GetEtaFromStrip(d,r,s,t,zvtx);
+ eta = etaCalc;
- //No corrections beyond this point
- // if(eta < -4) {
- // mult = 0; multNext = 0; multNextNext = 0;
- // }
+ if (mult > 0 && mult != AliESDFMD::kInvalidMult ) {
+ Double_t cosOld = ETA2COS(etaOld);
+ Double_t cosNew = ETA2COS(etaCalc);
+ Double_t corr = cosNew / cosOld;
+ mult *= corr;
+ multNext *= corr;
+ multNextNext *= corr;
+ }
}
// Keep dead-channel information.
eTotal = eTotal + multNext;
used = kTRUE;
histos->fTriple->Fill(eTotal);
+ nTriple++;
twoLow = kFALSE;
}
else {
used = kFALSE;
histos->fDouble->Fill(eTotal);
+ nDouble++;
}
etot = eTotal;
eTotal = -1;
etot = mult + multNext;
used=kTRUE;
histos->fDouble->Fill(etot);
+ nDouble++;
}
else {
etot = 0;
if(etot > 0) {
histos->fSingle->Fill(etot);
histos->fSinglePerStrip->Fill(etot,t);
+ nSingle++;
}
}
}
}
//if(mult>0 && multNext >0)
// std::cout<<mult<<" "<<multNext<<" "<<mergedEnergy<<std::endl;
- }
- else {
+ } // End of simple merge
+ else { // Not simple
// Get next and previous signal - if any
Double_t prevE = 0;
Double_t nextE = 0;
#endif
// If we're processing on non-angle corrected data, we
// should do the angle correction here
- }
+ } // End of non-simple
if (!fCorrectAngles)
mergedEnergy = AngleCorrect(mergedEnergy, eta);
if (mergedEnergy > 0) histos->Incr();
fSummed->Fill(kMergedWithOther, nMerged);
fSummed->Fill(kMergedInto, nSummed);
- DBGL(5, Form("none=%9d, candidate=%9d, merged=%9d, summed=%9d",
- nNone, nCandidate, nMerged, nSummed));
+ DMSG(fDebug, 3,"single=%9d, double=%9d, triple=%9d",
+ nSingle, nDouble, nTriple);
next.Reset();
while ((o = static_cast<RingHistos*>(next())))
o->Finish();
fLowCuts->SetDirectory(0);
d->Add(fLowCuts);
- TNamed* angle = new TNamed("angle", fCorrectAngles ?
- "corrected" : "uncorrected");
- angle->SetUniqueID(fCorrectAngles);
- TNamed* low = new TNamed("lowSignal", fZeroSharedHitsBelowThreshold ?
- "zeroed" : "kept");
- low->SetUniqueID(fZeroSharedHitsBelowThreshold);
- TNamed* simple = new TNamed("simple", fUseSimpleMerging ? "yes" : "no");
- simple->SetUniqueID(fUseSimpleMerging);
-
// d->Add(lowCut);
// d->Add(nXi);
// d->Add(sigma);
- d->Add(angle);
- d->Add(low);
- d->Add(simple);
+ d->Add(AliForwardUtil::MakeParameter("angle", fCorrectAngles));
+ d->Add(AliForwardUtil::MakeParameter("lowSignal",
+ fZeroSharedHitsBelowThreshold));
+ d->Add(AliForwardUtil::MakeParameter("simple", fUseSimpleMerging));
fLCuts.Output(d,"lCuts");
fHCuts.Output(d,"hCuts");
UShort_t iVzMc; // Vertex bin from MC
Double_t vZMc; // Z coordinate of IP vertex from MC
Double_t b; // Impact parameter
+ Double_t cMC; // Centrality estimate from b
Int_t nPart; // Number of participants
Int_t nBin; // Number of binary collisions
Double_t phiR; // Reaction plane from MC
UInt_t retESD = fInspector.Process(esd, triggers, lowFlux, iVz, vZ,
cent, nClusters);
fInspector.ProcessMC(mcEvent, triggers, iVzMc, vZMc,
- b, nPart, nBin, phiR);
+ b, cMC, nPart, nBin, phiR);
Bool_t isInel = triggers & AliAODForwardMult::kInel;
Bool_t hasVtx = retESD == AliFMDMCEventInspector::kOk;
Double_t vzMC = 0;
Double_t phiR = 0;
Double_t b = 0;
+ Double_t cMC = 0;
Int_t npart = 0;
Int_t nbin = 0;
// UInt_t foundMC =
- fEventInspector.ProcessMC(mcEvent, triggers, ivzMC, vzMC, b,
+ fEventInspector.ProcessMC(mcEvent, triggers, ivzMC, vzMC, b, cMC,
npart, nbin, phiR);
fEventInspector.CompareResults(vz, vzMC, cent, b, npart, nbin);
//
// Get the ESD event. IF this is the first event, initialise
//
- if (IsZombie()) return 0;
+ DGUARD(fDebug,2,"Get the ESD event");
+ if (IsZombie()) {
+ DMSG(fDebug,3,"We're a Zombie - bailing out");
+ return 0;
+ }
AliESDEvent* esd = dynamic_cast<AliESDEvent*>(InputEvent());
if (!esd) {
AliWarning("No ESD event found for input event");
// Parameters:
// option Not used
//
+ DGUARD(fDebug,1,"Process the input event");
// static Int_t cnt = 0;
// cnt++;
UInt_t found = fEventInspector.Process(esd, triggers, lowFlux,
ivz, vz, cent, nClusters);
- if (found & AliFMDEventInspector::kNoEvent) return;
- if (found & AliFMDEventInspector::kNoTriggers) return;
- if (found & AliFMDEventInspector::kNoSPD) return;
- if (found & AliFMDEventInspector::kNoFMD) return;
- if (found & AliFMDEventInspector::kNoVertex) return;
- if (triggers & AliAODForwardMult::kPileUp) return;
- if (found & AliFMDEventInspector::kBadVertex) return;
+ Bool_t ok = true;
+ if (found & AliFMDEventInspector::kNoEvent) ok = false;
+ if (found & AliFMDEventInspector::kNoTriggers) ok = false;
+ if (found & AliFMDEventInspector::kNoSPD) ok = false;
+ if (found & AliFMDEventInspector::kNoFMD) ok = false;
+ if (found & AliFMDEventInspector::kNoVertex) ok = false;
+ if (triggers & AliAODForwardMult::kPileUp) ok = false;
+ if (found & AliFMDEventInspector::kBadVertex) ok = false;
+ if (!ok) {
+ DMSG(fDebug,2,"Event failed selection: %s",
+ AliFMDEventInspector::CodeString(found));
+ return;
+ }
+ DMSG(fDebug,2,"Event triggers: %s", AliAODForwardMult::GetTriggerString(triggers));
// We we do not want to use low flux specific code, we disable it here.
if (!fEnableLowFlux) lowFlux = false;
#include <AliPhysicsSelection.h>
#include <AliTriggerAnalysis.h>
#include <AliMultiplicity.h>
+#include <TParameter.h>
#include <TH2D.h>
#include <TH1I.h>
#include <TF1.h>
return false;
}
-
+//_____________________________________________________________________
+TObject* AliForwardUtil::MakeParameter(const Char_t* name, UShort_t value)
+{
+ TParameter<int>* ret = new TParameter<int>(name, value);
+ ret->SetUniqueID(value);
+ return ret;
+}
+//_____________________________________________________________________
+TObject* AliForwardUtil::MakeParameter(const Char_t* name, Int_t value)
+{
+ TParameter<int>* ret = new TParameter<int>(name, value);
+ ret->SetUniqueID(value);
+ return ret;
+}
+//_____________________________________________________________________
+TObject* AliForwardUtil::MakeParameter(const Char_t* name, Double_t value)
+{
+ TParameter<double>* ret = new TParameter<double>(name, value);
+ Float_t v = value;
+ ret->SetUniqueID(*reinterpret_cast<UInt_t*>(&v));
+ return ret;
+}
+//_____________________________________________________________________
+TObject* AliForwardUtil::MakeParameter(const Char_t* name, Bool_t value)
+{
+ TParameter<bool>* ret = new TParameter<bool>(name, value);
+ ret->SetUniqueID(value);
+ return ret;
+}
+
+//_____________________________________________________________________
+void AliForwardUtil::GetParameter(TObject* o, UShort_t& value)
+{
+ if (!o) return;
+ value = o->GetUniqueID();
+}
+//_____________________________________________________________________
+void AliForwardUtil::GetParameter(TObject* o, Int_t& value)
+{
+ if (!o) return;
+ value = o->GetUniqueID();
+}
+//_____________________________________________________________________
+void AliForwardUtil::GetParameter(TObject* o, Double_t& value)
+{
+ if (!o) return;
+ UInt_t i = o->GetUniqueID();
+ Float_t v = *reinterpret_cast<Float_t*>(&i);
+ value = v;
+}
+//_____________________________________________________________________
+void AliForwardUtil::GetParameter(TObject* o, Bool_t& value)
+{
+ if (!o) return;
+ value = o->GetUniqueID();
+}
//_____________________________________________________________________
Double_t AliForwardUtil::GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Double_t zvtx)
*/
static Bool_t CheckForTask(const char* clsOrName, Bool_t cls=true);
+ //__________________________________________________________________
+ /**
+ * @{
+ * @name Member functions to store and retrieve analysis parameters
+ */
+ static TObject* MakeParameter(const char* name, UShort_t value);
+ static TObject* MakeParameter(const char* name, Int_t value);
+ static TObject* MakeParameter(const char* name, Double_t value);
+ static TObject* MakeParameter(const char* name, Bool_t value);
+ static void GetParameter(TObject* o, UShort_t& value);
+ static void GetParameter(TObject* o, Int_t& value);
+ static void GetParameter(TObject* o, Double_t& value);
+ static void GetParameter(TObject* o, Bool_t& value);
+ /* @} */
+
/**
* @{
* @name Energy stragling functions