fClusMinE(-1),
fTrackMinPt(-1),
fTriggers(0),
+ fZvertex(-1),
+ fZvertexDiff(0),
+ fCentMin(-1),
+ fCentMax(-1),
fIsFastOnly(0),
fIsLedEvent(0),
fIsGoodEvent(0),
res = aev->GetHeader()->GetOfflineTrigger();
}
- // return 0, if 0 found.
+ // return 0, if 0 found
if (res==0)
return 0;
+ // return 0, if ptrs are not set
+ if ((eev==0) && (aev==0))
+ return 0;
+
if (fTriggers) { // only process given triggers
- if (res & fTriggers == 0)
+ if ((res & fTriggers) == 0)
return res;
}
+ AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
+
fIsFastOnly = kFALSE;
fIsGoodEvent = kFALSE;
fIsLedEvent = kFALSE;
fClusMaxE = -1;
fTrackMaxPt = -1;
- if ((res & AliVEvent::kAnyINT) ||
- (res & AliVEvent::kEMC1) ||
- (res & AliVEvent::kEMC7) ||
- (res & AliVEvent::kEMCEJE) ||
+ if ((res & AliVEvent::kAnyINT) ||
+ (res & AliVEvent::kSemiCentral) ||
+ (res & AliVEvent::kCentral) ||
+ (res & AliVEvent::kEMC1) ||
+ (res & AliVEvent::kEMC7) ||
+ (res & AliVEvent::kEMCEJE) ||
(res & AliVEvent::kEMCEGA))
fIsGoodEvent = kTRUE;
- AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
+ if (fZvertexDiff || (fZvertex>0)) {
+ Double_t vzPRI = +999;
+ Double_t vzSPD = -999;
+ const AliVVertex *pv = 0;
+ if (eev)
+ pv = eev->GetPrimaryVertex();
+ else
+ pv = aev->GetPrimaryVertex();
+ if (pv && pv->GetNContributors()>0) {
+ vzPRI = pv->GetZ();
+ }
+ const AliVVertex *sv = 0;
+ if (eev)
+ sv = eev->GetPrimaryVertexSPD();
+ else
+ sv = aev->GetPrimaryVertexSPD();
+ if (sv && sv->GetNContributors()>0) {
+ vzSPD = sv->GetZ();
+ }
+ Double_t dvertex = TMath::Abs(vzPRI-vzSPD);
+ // skip events with dvertex<1mm if requested
+ // https://indico.cern.ch/getFile.py/access?contribId=4&resId=0&materialId=slides&confId=189624
+ // also check on vertex z if requested
+ if (fZvertexDiff && (dvertex<0.1))
+ fIsGoodEvent = kFALSE;
+ if ((fZvertex>0) && (TMath::Abs(dvertex)>fZvertex))
+ fIsGoodEvent = kFALSE;
+ }
+
+ if ((fCentMin>-1) && (fCentMax>-1)) {
+ Double_t v0mcent = -1;
+ AliCentrality *centin = 0;
+ if (eev) {
+ am->LoadBranch("Centrality.");
+ centin = dynamic_cast<AliCentrality*>(eev->FindListObject("Centrality"));
+ } else {
+ centin = const_cast<AliAODEvent*>(aev)->GetCentrality();
+ }
+ if (centin)
+ v0mcent = centin->GetCentralityPercentileUnchecked("V0M");
+ if ((v0mcent<fCentMin) && (v0mcent>fCentMax))
+ fIsGoodEvent = kFALSE;
+ }
+
AliVCaloCells *cells = ev->GetEMCALCells();
const Short_t nCells = cells->GetNumberOfCells();
virtual UInt_t GetSelectionMask(const TObject* obj);
void SetCellMinE(Double_t e) { fCellMinE = e; }
+ void SetCentRange(Double_t min, Double_t max) { fCentMin = min; fCentMax = max; }
+ void SetCheckZvertexDiff(Bool_t b) { fZvertexDiff = b; }
void SetClusMinE(Double_t e) { fClusMinE = e; }
void SetMarkFastOnly(Bool_t b) { fMarkFastOnly = b; }
void SetMarkLedEvent(Bool_t b) { fMarkLedEvent = b; }
void SetSkipLedEvent(Bool_t b) { fSkipLedEvent = b; }
void SetTrackMinPt(Double_t p) { fTrackMinPt = p; }
void SetTriggers(UInt_t t) { fTriggers = t; }
-
+ void SetZVertex(Double_t z=10) { fZvertex = z; }
+
Double_t GetCellMaxE() const { return fCellMaxE; }
Double_t GetClusMaxE() const { return fClusMaxE; }
Double_t GetTrackMaxPt() const { return fTrackMaxPt; }
Double_t fClusMinE; //minimum clus energy (<0 -> do not compute)
Double_t fTrackMinPt; //minimum track pt (<0 -> do not compute)
UInt_t fTriggers; //if not zero only process given trigges
+ Double_t fZvertex; //primary vertex z cut (-1 none)
+ Bool_t fZvertexDiff; //=true then select on PRI minus SPD z-vertex
+ Double_t fCentMin; //minimum centrality required (V0M)
+ Double_t fCentMax; //maximum centrality required (V0M)
Bool_t fIsFastOnly; //!=true if FASTONLY event is found
Bool_t fIsLedEvent; //!=true if LED event is found
Bool_t fIsGoodEvent; //!=true if good EMCAL event
Double_t fCellMaxE; //!maximum cell energy in event
Double_t fClusMaxE; //!maximum clus energy in event
Double_t fTrackMaxPt; //!maximum track pt in event
-
- ClassDef(AliEmcalPhysicsSelection, 3); // Emcal physics selection
+
+ ClassDef(AliEmcalPhysicsSelection, 4); // Emcal physics selection
};
#endif
Bool_t wHistos = kTRUE,
UInt_t triggers = 0,
Double_t minE = -1,
- Double_t minPt = -1
+ Double_t minPt = -1,
+ Double_t vz = -1,
+ Bool_t vzdiff = kFALSE,
+ Double_t cmin = -1,
+ Double_t cmax = -1
)
{
// Add EMCAL physics selection task.
physSel->SetClusMinE(minE);
physSel->SetTrackMinPt(minPt);
physSel->SetTriggers(triggers);
+ physSel->SetCentRange(cmin,cmax);
+ physSel->SetZVertex(vz);
+ physSel->SetCheckZvertexDiff(vzdiff);
} else {
::Error("AddTaskEmcalPhysicsSelection", "No AliEmcalPhysicsSelection object found.");
}