1 /**************************************************************************
2 * Copyright(c) 2013, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 // evaluate TRD trigger conditions,
17 // potentially with hardened conditions to remove
18 // triggers caused by conversions of low-pt photons
21 // Author: Jochen Klein <jochen.klein@cern.ch>
24 #include "AliVTrack.h"
25 #include "AliVEvent.h"
26 #include "AliVTrdTrack.h"
28 #include "AliTRDTriggerAnalysis.h"
30 AliTRDTriggerAnalysis::AliTRDTriggerAnalysis() :
35 fRequireMatch(kFALSE),
36 fRequireMatchElectron(kTRUE),
37 fRequireInTime(kFALSE),
52 AliTRDTriggerAnalysis::~AliTRDTriggerAnalysis()
57 Bool_t AliTRDTriggerAnalysis::CalcTriggers(const AliVEvent *event)
59 // evaluate the TRD trigger conditions,
60 // so far HCO, HSE, HQU, HJT, HEE
65 AliErrorClass("event pointer is null");
69 TString trgClasses = event->GetFiredTriggerClasses();
70 // UInt_t trgInputs = event->GetHeader()->GetL1TriggerInputs();
72 Int_t nTracks[90] = { 0 }; // stack-wise counted number of tracks above pt threshold
74 Int_t nTrdTracks = event->GetNumberOfTrdTracks();
79 for (Int_t iTrack = 0; iTrack < nTrdTracks; ++iTrack) {
80 AliVTrdTrack *trdTrack = event->GetTrdTrack(iTrack);
84 // ignore the track if it was not in time
86 if (fRequireInTime && !trdTrack->GetTrackInTime())
89 AliVTrack *match = trdTrack->GetTrackMatch();
90 AliDebug(2, Form("GTU track %2i with pt = %5.2f has match: %p (pt = %5.2f)",
91 iTrack, trdTrack->Pt(), match, match ? match->Pt() : 0));
93 // ignore the track if it does not have a matched global track
95 if (fRequireMatch && !match)
98 Int_t globalStack = 5*trdTrack->GetSector() + trdTrack->GetStack();
100 // stack-wise counting of tracks above pt threshold for jet trigger
101 if (TMath::Abs(trdTrack->GetPt()) >= fTRDptHJT) {
102 ++nTracks[globalStack];
105 // ignore the track for the electron triggers
106 // if it does not have a matched global track
108 if (fRequireMatchElectron && !match)
111 if ((TMath::Abs(trdTrack->Pt()) > fTRDptHQU) && (trdTrack->GetPID() > fTRDpidHQU))
114 if ((TMath::Abs(trdTrack->Pt()) > fTRDptHSE) && (trdTrack->GetPID() > fTRDpidHSE))
117 if ((trdTrack->GetSector() >= fTRDminSectorHEE) && (trdTrack->GetSector() <= fTRDmaxSectorHEE) &&
118 (TMath::Abs(trdTrack->Pt()) > fTRDptHSE) && (trdTrack->GetPID() > fTRDpidHSE))
122 // check if HJT condition is fulfilled in any stack
123 for (Int_t iStack = 0; iStack < 90; ++iStack) {
124 if (nTracks[iStack] >= fTRDnHJT) {