Add it to PartCorr frame.
Selection in 3 different places, to be moved to common place, maybe AliEMCALRecoUtils
//Remove the contents of output list set in the previous event
fOutputAODBranch->Clear("C");
- // Reject event if large clusters with large energy
- // Use only for LHC11a data for the moment, and if input is clusterizer V1 or V1+unfolding
- // If clusterzer NxN or V2 it does not help
- if(fRemoveLEDEvents){
- for (Int_t i = 0; i < InputEvent()->GetNumberOfCaloClusters(); i++)
- {
- AliVCluster *clus = InputEvent()->GetCaloCluster(i);
- if(clus->IsEMCAL()){
-
- if ((clus->E() > 500 && clus->GetNCells() > 200 ) || clus->GetNCells() > 300) {
- Int_t absID = clus->GetCellsAbsId()[0];
- Int_t sm = fGeom->GetSuperModuleNumber(absID);
- printf("AliAnalysisTaskEMCALClusterize - reject event with cluster : E %f, ncells %d, absId(0) %d, SM %d\n",clus->E(), clus->GetNCells(),absID, sm);
-
- return;
- }
- }
- }
- }// Remove LED events
-
//Magic line to write events to AOD file
AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(fFillAODFile);
LoadBranches();
return;
}
+ //-------------------------------------------------------------------------------------
+ // Reject event if large clusters with large energy
+ // Use only for LHC11a data for the moment, and if input is clusterizer V1 or V1+unfolding
+ // If clusterzer NxN or V2 it does not help
+ //-------------------------------------------------------------------------------------
+ if(fRemoveLEDEvents){
+ for (Int_t i = 0; i < InputEvent()->GetNumberOfCaloClusters(); i++)
+ {
+ AliVCluster *clus = InputEvent()->GetCaloCluster(i);
+ if(clus->IsEMCAL()){
+
+ if ((clus->E() > 500 && clus->GetNCells() > 200 ) || clus->GetNCells() > 200) {
+ Int_t absID = clus->GetCellsAbsId()[0];
+ Int_t sm = fGeom->GetSuperModuleNumber(absID);
+ printf("AliAnalysisTaskEMCALClusterize - reject event with cluster : E %f, ncells %d, absId(0) %d, SM %d\n",clus->E(), clus->GetNCells(),absID, sm);
+
+ return;
+ }
+ }
+ }
+
+ // Count number of cells with energy larger than 0.1 in SM3, cut on this number
+ Int_t ncells = 0;
+ for(Int_t icell = 0; icell < event->GetEMCALCells()->GetNumberOfCells(); icell++){
+ if(event->GetEMCALCells()->GetAmplitude(icell) > 0.1 && event->GetEMCALCells()->GetCellNumber(icell)/(24*48)==3) ncells++;
+ }
+
+ TString triggerclasses = "";
+ if(esdevent) triggerclasses = esdevent ->GetFiredTriggerClasses();
+ else triggerclasses = ((AliAODEvent*)event)->GetFiredTriggerClasses();
+
+ Int_t ncellcut = 21;
+ if(triggerclasses.Contains("EMC")) ncellcut = 35;
+
+ if(ncells >= ncellcut ){
+ printf("AliAnalysisTaskEMCALClusterize - reject event with cluster - reject event with ncells in SM3: ncells %d\n",ncells);
+
+ return;
+ }
+
+ }// Remove LED events
+
//-------------------------------------------------------------------------------------
//Set the geometry matrix, for the first event, skip the rest
//-------------------------------------------------------------------------------------
#include "AliAODHeader.h"
#include "AliTriggerAnalysis.h"
#include "AliESDEvent.h"
+#include "AliAODEvent.h"
#include "AliESDtrackCuts.h"
#include "AliAnalysisManager.h"
#include "AliInputEventHandler.h"
//________________________________________________________________________
AliAnalysisTaskCounter::AliAnalysisTaskCounter(const char *name)
: AliAnalysisTaskSE(name),
- fZVertexCut(10.),
+ fAcceptFastCluster(kTRUE),
+ fZVertexCut(10.),
fTrackMultEtaCut(0.8),
fCaloFilterPatch(kFALSE),
fOutputContainer(0x0),
fESDtrackCuts(AliESDtrackCuts::GetStandardITSTPCTrackCuts2010()),
fTriggerAnalysis (new AliTriggerAnalysis),
fhNEvents(0),
- fhXVertex(0),fhYVertex(0),fhZVertex(0),
+ fhXVertex(0), fhYVertex(0), fhZVertex(0),
fhXGoodVertex(0),fhYGoodVertex(0),fhZGoodVertex(0)
{
//ctor
//________________________________________________________________________
AliAnalysisTaskCounter::AliAnalysisTaskCounter()
: AliAnalysisTaskSE("DefaultAnalysis_AliAnalysisTaskCounter"),
+ fAcceptFastCluster(kTRUE),
fZVertexCut(10.),
fTrackMultEtaCut(0.8),
fCaloFilterPatch(kFALSE),
fESDtrackCuts(AliESDtrackCuts::GetStandardITSTPCTrackCuts2010()),
fTriggerAnalysis (new AliTriggerAnalysis),
fhNEvents(0),
- fhXVertex(0),fhYVertex(0),fhZVertex(0),
+ fhXVertex(0), fhYVertex(0), fhZVertex(0),
fhXGoodVertex(0),fhYGoodVertex(0),fhZGoodVertex(0)
{
// ctor
fOutputContainer->Add(fhYGoodVertex);
- fhNEvents = new TH1I("hNEvents", "Number of analyzed events", 20, 0, 20) ;
+ fhNEvents = new TH1I("hNEvents", "Number of analyzed events", 21, 0, 21) ;
fhNEvents->SetXTitle("Selection");
fhNEvents->SetYTitle("# events");
fhNEvents->GetXaxis()->SetBinLabel(1 ,"1 = PS");
fhNEvents->GetXaxis()->SetBinLabel(16,"16 = 10 & 11");
fhNEvents->GetXaxis()->SetBinLabel(17,"17 = 6 & 10");
fhNEvents->GetXaxis()->SetBinLabel(17,"17 = 1 & |Z|<50");
- fhNEvents->GetXaxis()->SetBinLabel(18,"18 = Reject EMCAL");
+ fhNEvents->GetXaxis()->SetBinLabel(18,"18 = Reject EMCAL 1");
fhNEvents->GetXaxis()->SetBinLabel(19,"19 = 18 & 2");
- fhNEvents->GetXaxis()->SetBinLabel(20,"20 = 18 & |Z|<50");
+ fhNEvents->GetXaxis()->SetBinLabel(20,"20 = Reject EMCAL 2");
+ fhNEvents->GetXaxis()->SetBinLabel(21,"20 = 20 & 2");
fOutputContainer->Add(fhNEvents);
printf("AliAnalysisTaskCounter::UserExec() - ERROR: event not available \n");
return;
}
+
AliESDEvent * esdevent = dynamic_cast<AliESDEvent*> (event);
+ AliAODEvent * aodevent = dynamic_cast<AliAODEvent*> (event);
+
+ TString triggerclasses = "";
+ if(esdevent) triggerclasses = esdevent->GetFiredTriggerClasses();
+ if(aodevent) triggerclasses = aodevent->GetFiredTriggerClasses();
+
+ if (triggerclasses.Contains("FAST") && !triggerclasses.Contains("ALL") && !fAcceptFastCluster) {
+ //printf("Do not count events from fast cluster, trigger name %s\n",triggerclasses.Data());
+ return;
+ }
fhNEvents->Fill(1.5);
//printf("AliAnalysisTaskCounter::UserExec() : z vertex %d, good vertex %d, v0and %d, pile up %d, track mult %d\n ", bSelectVZ, bGoodV, bV0AND, bPileup, trackMult);
// Events that could be rejected in EMCAL
+ // LHC11a, SM4 and some SM3 events cut with this
+ Bool_t bEMCALRejected = kFALSE;
for (Int_t i = 0; i < InputEvent()->GetNumberOfCaloClusters(); i++)
{
AliVCluster *clus = InputEvent()->GetCaloCluster(i);
if(clus->IsEMCAL()){
-
- if ((clus->E() > 500 && clus->GetNCells() > 200 ) || clus->GetNCells() > 300) {
+ if ((clus->E() > 500 && clus->GetNCells() > 200 ) || clus->GetNCells() > 200) {
+
//printf("Counter: Reject event with cluster: E %f, ncells %d\n",clus->E(),clus->GetNCells());
+
fhNEvents->Fill(17.5);
if(bSelectVZ) fhNEvents->Fill(18.5);
- if(TMath::Abs(v[2]) < 50.) fhNEvents->Fill(19.5);
+ bEMCALRejected = kTRUE;
break;
}
-
}
}
+ //LHC11a, 3 last runs, cut with this
+ if(!bEMCALRejected){
+ // Count number of cells in SM3 with energy larger than 0.1, cut on this number
+ Int_t ncells = 0;
+ for(Int_t icell = 0; icell < event->GetEMCALCells()->GetNumberOfCells(); icell++){
+ if(event->GetEMCALCells()->GetAmplitude(icell) > 0.1 && event->GetEMCALCells()->GetCellNumber(icell)/(24*48)==3) ncells++;
+ }
+
+ Int_t ncellcut = 21;
+ if(triggerclasses.Contains("EMC")) ncellcut = 35;
+
+ if(ncells >= ncellcut ){
+
+ //printf("Counter: reject event with ncells in SM3: ncells %d\n",ncells);
+
+ fhNEvents->Fill(19.5);
+ if(bSelectVZ) fhNEvents->Fill(20.5);
+ }
+
+ }
+
PostData(1,fOutputContainer);
}
virtual void UserExec(Option_t *option);
virtual void FinishTaskOutput();
- void SetTrackMultiplicityEtaCut(Float_t eta) { fTrackMultEtaCut = eta ; }
- void SetZVertexCut(Float_t vcut) { fZVertexCut = vcut ; }
+ void SetTrackMultiplicityEtaCut(Float_t eta) { fTrackMultEtaCut = eta ; }
+ void SetZVertexCut(Float_t vcut) { fZVertexCut = vcut ; }
- void SwitchOnCaloFilterPatch() { fCaloFilterPatch = kTRUE ; }
- void SwitchOffCaloFilterPatch() { fCaloFilterPatch = kFALSE ; }
- Bool_t IsCaloFilterPatchOn() { return fCaloFilterPatch ; }
+ void SwitchOnCaloFilterPatch() { fCaloFilterPatch = kTRUE ; }
+ void SwitchOffCaloFilterPatch() { fCaloFilterPatch = kFALSE ; }
+ Bool_t IsCaloFilterPatchOn() { return fCaloFilterPatch ; }
+
+ void AcceptFastCluster() { fAcceptFastCluster = kTRUE ; }
+ void RejectFastCluster() { fAcceptFastCluster = kFALSE ; }
+ Bool_t IsFastClusterAccepted() { return fAcceptFastCluster ; }
Bool_t CheckForPrimaryVertex() ;
private:
-
- Float_t fZVertexCut; // Z vertex cut
- Float_t fTrackMultEtaCut; // Track multiplicity eta cut
- Bool_t fCaloFilterPatch; // CaloFilter patch
- TList* fOutputContainer; //! Histogram container
- AliESDtrackCuts * fESDtrackCuts; // Track cut
- AliTriggerAnalysis * fTriggerAnalysis; // Trigger algorithm
+ Bool_t fAcceptFastCluster; // Accept events from fast cluster, exclude thiese events for LHC11a
+ Float_t fZVertexCut; // Z vertex cut
+ Float_t fTrackMultEtaCut; // Track multiplicity eta cut
+ Bool_t fCaloFilterPatch; // CaloFilter patch
+ TList* fOutputContainer; //! Histogram container
+ AliESDtrackCuts * fESDtrackCuts; // Track cut
+ AliTriggerAnalysis * fTriggerAnalysis; // Trigger algorithm
//Histograms
TH1I * fhNEvents; //! Events that delivers the analysis frame after different assumptions
fTaskName(""), fCaloUtils(0x0),
fMixedEvent(NULL), fNMixedEvent(1), fVertex(NULL),
fWriteOutputDeltaAOD(kFALSE),fOldAOD(kFALSE), fCaloFilterPatch(kFALSE),
- fEMCALClustersListName(""), fZvtxCut(0.),
+ fEMCALClustersListName(""), fZvtxCut(0.),
+ fAcceptFastCluster(kTRUE), fRemoveLEDEvents(kFALSE),
fDoEventSelection(kFALSE), fDoV0ANDEventSelection(kFALSE), fUseEventsWithPrimaryVertex(kFALSE),
fTriggerAnalysis (new AliTriggerAnalysis),
fCentralityClass("V0M"), fCentralityOpt(10),
if(fInputEvent->GetHeader())
eventType = ((AliVHeader*)fInputEvent->GetHeader())->GetEventType();
+ if (GetFiredTriggerClasses().Contains("FAST") && !GetFiredTriggerClasses().Contains("ALL") && !fAcceptFastCluster) {
+ if(fDebug > 0) printf("AliCaloTrackReader::FillInputEvent - Do not count events from fast cluster, trigger name %s\n",fFiredTriggerClassName.Data());
+ return kFALSE;
+ }
+
+ //-------------------------------------------------------------------------------------
+ // Reject event if large clusters with large energy
+ // Use only for LHC11a data for the moment, and if input is clusterizer V1 or V1+unfolding
+ // If clusterzer NxN or V2 it does not help
+ //-------------------------------------------------------------------------------------
+ if(fRemoveLEDEvents){
+ for (Int_t i = 0; i < fInputEvent->GetNumberOfCaloClusters(); i++)
+ {
+ AliVCluster *clus = fInputEvent->GetCaloCluster(i);
+ if(clus->IsEMCAL()){
+
+ if ((clus->E() > 500 && clus->GetNCells() > 200 ) || clus->GetNCells() > 200) {
+ Int_t absID = clus->GetCellsAbsId()[0];
+ Int_t sm = GetCaloUtils()->GetEMCALGeometry()->GetSuperModuleNumber(absID);
+ if(fDebug > 0) printf("AliCaloTrackReader::FillInputEvent - reject event with cluster : E %f, ncells %d, absId(0) %d, SM %d\n",clus->E(), clus->GetNCells(),absID, sm);
+ return kFALSE;
+ }
+ }
+ }
+
+ // Count number of cells with energy larger than 0.1 in SM3, cut on this number
+ Int_t ncells = 0;
+ for(Int_t icell = 0; icell < fInputEvent->GetEMCALCells()->GetNumberOfCells(); icell++){
+ Int_t absID = fInputEvent->GetEMCALCells()->GetCellNumber(icell);
+ Int_t sm = GetCaloUtils()->GetEMCALGeometry()->GetSuperModuleNumber(absID);
+ if(fInputEvent->GetEMCALCells()->GetAmplitude(icell) > 0.1 && sm==3) ncells++;
+ }
+
+ Int_t ncellcut = 21;
+ if(fFiredTriggerClassName.Contains("EMC")) ncellcut = 35;
+
+ if(ncells >= ncellcut ) {
+ if(fDebug > 0) printf(" AliCaloTrackReader::FillInputEvent() - reject event with ncells in SM3: ncells %d\n",ncells);
+ return kFALSE;
+ }
+ }// Remove LED events
+
+ // Reject pure LED events?
if( fFiredTriggerClassName !="" && !fAnaLED){
if(eventType!=7)
return kFALSE; //Only physics event, do not use for simulated events!!!
if(eventType!=7 && fDebug > 1 )printf("AliCaloTrackReader::FillInputEvent() - DO LED, Event Type <%d>, 8 Calibration \n", eventType);
if(eventType!=8)return kFALSE;
}
-
+
//In case of analysis of events with jets, skip those with jet pt > 5 pt hard
if(fComparePtHardAndJetPt && GetStack()) {
if(!ComparePtHardAndJetPt()) return kFALSE ;
// Event/track selection methods
//-------------------------------------
+ void AcceptFastClusterEvents() { fAcceptFastCluster = kTRUE ; }
+ void RejectFastClusterEvents() { fAcceptFastCluster = kFALSE ; }
+ Bool_t IsFastClusterAccepted() { return fAcceptFastCluster ; }
+
+ void SwitchOnLEDEventsRemoval() { fRemoveLEDEvents = kTRUE ; }
+ void SwitchOffLEDEventsRemoval() { fRemoveLEDEvents = kFALSE ; }
+ Bool_t IsLEDEventRemoved() { return fRemoveLEDEvents ; }
+
void SetFiredTriggerClassName(TString name ) { fFiredTriggerClassName = name ; }
TString GetFiredTriggerClassName() const { return fFiredTriggerClassName ; }
virtual TString GetFiredTriggerClasses() { return "" ; } // look the ESD/AOD reader
- void SwitchOnEventSelection() { fDoEventSelection = kTRUE ; }
- void SwitchOffEventSelection() { fDoEventSelection = kFALSE ; }
+ void SwitchOnEventSelection() { fDoEventSelection = kTRUE ; }
+ void SwitchOffEventSelection() { fDoEventSelection = kFALSE ; }
Bool_t IsEventSelectionDone() const { return fDoEventSelection ; }
void SwitchOnV0ANDSelection() { fDoV0ANDEventSelection = kTRUE ; }
void SwitchOffPrimaryVertexSelection() { fUseEventsWithPrimaryVertex = kFALSE ; }
Bool_t IsPrimaryVertexSelectionDone() const { return fUseEventsWithPrimaryVertex ; }
-
-
// Track selection
ULong_t GetTrackStatus() const { return fTrackStatus ; }
void SetTrackStatus(ULong_t bit) { fTrackStatus = bit ; }
Bool_t fCaloFilterPatch; // CaloFilter patch
TString fEMCALClustersListName; // Alternative list of clusters produced elsewhere and not from InputEvent
- Float_t fZvtxCut ; // Cut on vertex position
+
+ // Event selection
+ Float_t fZvtxCut ; // Cut on vertex position
+ Bool_t fAcceptFastCluster; // Accept events from fast cluster, exclude these events for LHC11a
+ Bool_t fRemoveLEDEvents; // Remove events where LED was wrongly firing - EMCAL LHC11a
Bool_t fDoEventSelection; // Select events depending on V0, pileup, vertex well reconstructed, at least 1 track ...
Bool_t fDoV0ANDEventSelection; // Select events depending on V0, fDoEventSelection should be on
Bool_t fUseEventsWithPrimaryVertex ; // Select events with primary vertex
Int_t fCentralityBin[2]; // Minimum and maximum value of the centrality for the analysis
TString fEventPlaneMethod; // Name of event plane method, by default "Q"
- ClassDef(AliCaloTrackReader,33)
+ ClassDef(AliCaloTrackReader,34)
} ;