forked from alisw/AliRoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,088 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
#include "AliVEvent.h" | ||
#include "AliESDEvent.h" | ||
#include "AliAODEvent.h" | ||
#include "AliVVertex.h" | ||
#include "AliLog.h" | ||
#include "AliAODVertex.h" | ||
|
||
#include "AliAnalysisUtils.h" | ||
|
||
ClassImp(AliAnalysisUtils) | ||
|
||
//______________________________________________________________________ | ||
AliAnalysisUtils::AliAnalysisUtils():TObject(), | ||
fisAOD(kTRUE), | ||
fMinVtxContr(0), | ||
fMaxVtxZ(10.), | ||
fCutOnZVertexSPD(kTRUE) | ||
{ | ||
// Default contructor | ||
} | ||
|
||
//______________________________________________________________________ | ||
Bool_t AliAnalysisUtils::IsVertexSelected2013pA(AliVEvent *event) | ||
{ | ||
Bool_t accept = kFALSE; | ||
|
||
// Check whether the event is of AOD or ESD type | ||
AliAODEvent *aod = 0x0; | ||
AliESDEvent *esd = 0x0; | ||
aod = dynamic_cast<AliAODEvent*>(event); | ||
esd = dynamic_cast<AliESDEvent*>(event); | ||
|
||
if(aod) { | ||
fisAOD = kTRUE; | ||
} else { | ||
fisAOD = kFALSE; | ||
if(!esd) { | ||
AliFatal("Event is neither of AOD nor ESD type"); | ||
return accept; | ||
} | ||
} | ||
|
||
const AliVVertex *trkVtx = fisAOD ? | ||
dynamic_cast<const AliVVertex*>(aod->GetPrimaryVertex()) : | ||
dynamic_cast<const AliVVertex*>(esd->GetPrimaryVertex()) ; | ||
if(!trkVtx || trkVtx->GetNContributors()<=fMinVtxContr){ | ||
accept = kFALSE; | ||
return accept; | ||
} | ||
|
||
TString vtxTtl = trkVtx->GetTitle(); | ||
if (!vtxTtl.Contains("VertexerTracks")) return accept; | ||
|
||
Float_t zvtx = trkVtx->GetZ(); | ||
const AliVVertex* spdVtx = fisAOD ? | ||
dynamic_cast<const AliVVertex*>(aod->GetPrimaryVertexSPD()) : | ||
dynamic_cast<const AliVVertex*>(esd->GetPrimaryVertexSPD()) ; | ||
if (spdVtx->GetNContributors()<=fMinVtxContr) return accept; | ||
|
||
TString vtxTyp = spdVtx->GetTitle(); | ||
Double_t cov[6]={0}; | ||
spdVtx->GetCovarianceMatrix(cov); | ||
Double_t zRes = TMath::Sqrt(cov[5]); | ||
if (vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) return accept; | ||
if (fCutOnZVertexSPD && TMath::Abs(spdVtx->GetZ() - trkVtx->GetZ())>0.5) return accept; | ||
|
||
if (TMath::Abs(zvtx) > fMaxVtxZ) return accept; | ||
|
||
return kTRUE; | ||
} | ||
|
||
//______________________________________________________________________ | ||
Bool_t AliAnalysisUtils::IsFirstEventInChunk(AliVEvent *event) | ||
{ | ||
|
||
Bool_t accept = kFALSE; | ||
|
||
// Check whether the event is of AOD or ESD type | ||
AliAODEvent *aod = 0x0; | ||
AliESDEvent *esd = 0x0; | ||
aod = dynamic_cast<AliAODEvent*>(event); | ||
esd = dynamic_cast<AliESDEvent*>(event); | ||
|
||
if(aod) { | ||
fisAOD = kTRUE; | ||
} else { | ||
fisAOD = kFALSE; | ||
if(!esd) { | ||
AliFatal("Event is neither of AOD nor ESD type"); | ||
return accept; | ||
} | ||
} | ||
|
||
if(fisAOD){ | ||
AliAODHeader *aodheader = 0x0; | ||
aodheader = aod->GetHeader(); | ||
if(!aodheader){ | ||
AliFatal("AOD header not there ?!"); | ||
return kFALSE; | ||
} | ||
if(aodheader->GetEventNumberESDFile()==0) accept = kTRUE; | ||
} else { | ||
if(esd->GetEventNumberInFile()==0) accept = kTRUE; | ||
} | ||
|
||
return accept; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#ifndef ALIANALYSISUTILS_H | ||
#define ALIANALYSISUTILS_H | ||
|
||
////////////////////////////////////////////////////////////////////////////// | ||
// // | ||
// Class with functions useful for different analyses // | ||
// - vertex selection // | ||
// * 2013 pA default cuts // | ||
// - identification of the fist event of the chunk // | ||
// // | ||
////////////////////////////////////////////////////////////////////////////// | ||
|
||
#include "TObject.h" | ||
|
||
class AliVEvent; | ||
|
||
class AliAnalysisUtils : public TObject { | ||
|
||
public: | ||
|
||
AliAnalysisUtils(); | ||
virtual ~AliAnalysisUtils(){}; | ||
|
||
Bool_t IsVertexSelected2013pA(AliVEvent *event); | ||
Bool_t IsFirstEventInChunk(AliVEvent *event); | ||
|
||
void SetMinVtxContr(Int_t contr=1) {fMinVtxContr=contr;} | ||
void SetMaxVtxZ(Float_t z=1e6) {fMaxVtxZ=z;} | ||
void SetCutOnZVertexSPD(Bool_t iscut=true) { fCutOnZVertexSPD = iscut; } | ||
|
||
private: | ||
|
||
Bool_t fisAOD; // flag for AOD:1 or ESD:0 | ||
|
||
Int_t fMinVtxContr; // minimum vertex contributors | ||
Float_t fMaxVtxZ; // maximum |z| of primary vertex | ||
|
||
Bool_t fCutOnZVertexSPD; // 0: no cut, 1: |zvtx-SPD - zvtx-TPC|<0.5cm | ||
|
||
ClassDef(AliAnalysisUtils,0) // base helper class | ||
}; | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.