fZvertexDiff(0),
fCentMin(-1),
fCentMax(-1),
+ fMinCellTrackScale(-1),
+ fMaxCellTrackScale(-1),
fIsFastOnly(0),
fIsLedEvent(0),
fIsGoodEvent(0),
}
}
- if (fTrackMinPt>0) {
- TClonesArray *trks = 0;
+ TClonesArray *trks = 0;
+ Int_t Ntracks = 0;
+
+ if (fTrackMinPt>0 || fMinCellTrackScale > 0 || fMaxCellTrackScale > 0) {
if (eev) {
am->LoadBranch("PicoTracks");
trks = dynamic_cast<TClonesArray*>(eev->FindListObject("PicoTracks"));
} else {
trks = dynamic_cast<TClonesArray*>(aev->FindListObject("tracks"));
}
- if (trks) {
- const Int_t Ntracks = trks->GetEntriesFast();
- for (Int_t iTracks = 0; iTracks < Ntracks; ++iTracks) {
- AliVTrack *track = static_cast<AliVTrack*>(trks->At(iTracks));
- if (!track)
- continue;
- if (aev) { // a bit ugly since cuts are hard coded for now
- AliAODTrack *aodtrack = static_cast<AliAODTrack*>(track);
- if (!aodtrack->TestFilterBit(256) && !aodtrack->TestFilterBit(512))
- continue;
- }
- Double_t pt = track->Pt();
- if (pt>fTrackMaxPt)
- fTrackMaxPt = pt;
+ if (trks)
+ Ntracks = trks->GetEntriesFast();
+ }
+
+ Int_t nAccTracks = 0;
+
+ if (fTrackMinPt>0 || fMinCellTrackScale > 0 || fMaxCellTrackScale > 0) {
+ for (Int_t iTracks = 0; iTracks < Ntracks; ++iTracks) {
+ AliVTrack *track = static_cast<AliVTrack*>(trks->At(iTracks));
+ if (!track)
+ continue;
+ if (aev) { // a bit ugly since cuts are hard coded for now
+ AliAODTrack *aodtrack = static_cast<AliAODTrack*>(track);
+ if (!aodtrack->TestFilterBit(256) && !aodtrack->TestFilterBit(512))
+ continue;
}
+ nAccTracks++;
+ Double_t pt = track->Pt();
+ if (pt>fTrackMaxPt)
+ fTrackMaxPt = pt;
}
}
+ if (fMinCellTrackScale > 0 || fMaxCellTrackScale > 0) {
+ if (nCells < fMinCellTrackScale * nAccTracks || nCells > fMaxCellTrackScale * nAccTracks)
+ fIsGoodEvent = kFALSE;
+ }
+
// bad cell criterion for LHC11a from
// https://indico.cern.ch/materialDisplay.py?contribId=4&materialId=slides&confId=147067
const Int_t runN = ev->GetRunNumber();
void SetTrackMinPt(Double_t p) { fTrackMinPt = p; }
void SetTriggers(UInt_t t) { fTriggers = t; }
void SetZVertex(Double_t z=10) { fZvertex = z; }
+ void SetCellTrackScale(Double_t min, Double_t max) { fMinCellTrackScale = min; fMaxCellTrackScale = max; }
Double_t GetCellMaxE() const { return fCellMaxE; }
Double_t GetClusMaxE() const { return fClusMaxE; }
Bool_t IsGoodEvent() const { return fIsGoodEvent; }
protected:
- Bool_t fMarkFastOnly; //=true then mark FastOnly events (only for LHC11a)
- Bool_t fMarkLedEvent; //=true then mark Led events (only for LHC11a)
- Bool_t fSkipFastOnly; //=true then skip FastOnly events (only for LHC11a)
- Bool_t fSkipLedEvent; //=true then skip Led events (only for LHC11a)
- Double_t fCellMinE; //minimum cell energy (<0 -> do not compute)
- 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
+ Bool_t fMarkFastOnly; //=true then mark FastOnly events (only for LHC11a)
+ Bool_t fMarkLedEvent; //=true then mark Led events (only for LHC11a)
+ Bool_t fSkipFastOnly; //=true then skip FastOnly events (only for LHC11a)
+ Bool_t fSkipLedEvent; //=true then skip Led events (only for LHC11a)
+ Double_t fCellMinE; //minimum cell energy (<0 -> do not compute)
+ 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)
+ Double_t fMinCellTrackScale; //minimum cells over tracks scale
+ Double_t fMaxCellTrackScale; //maximum cells over tracks scale
+ 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, 4); // Emcal physics selection
};
Double_t vz = -1,
Bool_t vzdiff = kFALSE,
Double_t cmin = -1,
- Double_t cmax = -1
+ Double_t cmax = -1,
+ Double_t minCellTrackScale = -1,
+ Double_t maxCellTrackScale = -1
)
{
// Add EMCAL physics selection task.
Bool_t isMC = (mgr->GetMCtruthEventHandler()) ? kTRUE:kFALSE;
AliEmcalPhysicsSelectionTask *pseltask = new AliEmcalPhysicsSelectionTask("EmcalPSel");
pseltask->SetDoWriteHistos(wHistos);
- AliEmcalPhysicsSelection *physSel = pseltask->GetPhysicsSelection();
+ AliEmcalPhysicsSelection *physSel = static_cast<AliEmcalPhysicsSelection*>(pseltask->GetPhysicsSelection());
if (physSel) {
physSel->SetSkipFastOnly(exFOnly);
if (isMC)
physSel->SetCentRange(cmin,cmax);
physSel->SetZVertex(vz);
physSel->SetCheckZvertexDiff(vzdiff);
+ physSel->SetCellTrackScale(minCellTrackScale,maxCellTrackScale);
} else {
::Error("AddTaskEmcalPhysicsSelection", "No AliEmcalPhysicsSelection object found.");
}