Class to analyze TRD trigger data (Yvonne Packmayer)
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 May 2013 12:56:30 +0000 (12:56 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 May 2013 12:56:30 +0000 (12:56 +0000)
ANALYSIS/ANALYSISaliceLinkDef.h
ANALYSIS/AliTRDTriggerAnalysis.cxx [new file with mode: 0644]
ANALYSIS/AliTRDTriggerAnalysis.h [new file with mode: 0644]
ANALYSIS/CMakelibANALYSISalice.pkg

index 4f272c2..0a13f0c 100644 (file)
@@ -23,6 +23,7 @@
 #pragma link C++ class AliMultiEventInputHandler+;
 
 #pragma link C++ class AliTriggerAnalysis+;
+#pragma link C++ class AliTRDTriggerAnalysis+;
 
 #pragma link C++ class AliPhysicsSelection+;
 #pragma link C++ class AliPhysicsSelectionTask+;
diff --git a/ANALYSIS/AliTRDTriggerAnalysis.cxx b/ANALYSIS/AliTRDTriggerAnalysis.cxx
new file mode 100644 (file)
index 0000000..1cfae4f
--- /dev/null
@@ -0,0 +1,131 @@
+/**************************************************************************
+ * Copyright(c) 2013, ALICE Experiment at CERN, All rights reserved.      *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+// evaluate TRD trigger conditions,
+// potentially with hardened conditions to remove
+// triggers caused by conversions of low-pt photons
+// at large radii
+//
+// Author: Jochen Klein <jochen.klein@cern.ch>
+
+#include "AliLog.h"
+#include "AliVTrack.h"
+#include "AliESDEvent.h"
+#include "AliESDTrdTrack.h"
+
+#include "AliTRDTriggerAnalysis.h"
+
+AliTRDTriggerAnalysis::AliTRDTriggerAnalysis() :
+  TObject(),
+  fTriggerFlags(0),
+  fTriggerInputs(0),
+  fTriggerClasses(0),
+  fRequireMatch(kFALSE),
+  fRequireMatchElectron(kTRUE),
+  fRequireInTime(kFALSE),
+  fTRDptHSE(3.),
+  fTRDpidHSE(144),
+  fTRDptHQU(2.),
+  fTRDpidHQU(164),
+  fTRDptHEE(3.),
+  fTRDpidHEE(144),
+  fTRDminSectorHEE(6),
+  fTRDmaxSectorHEE(8),
+  fTRDptHJT(3.),
+  fTRDnHJT(3)
+{
+  // ctor
+}
+
+AliTRDTriggerAnalysis::~AliTRDTriggerAnalysis()
+{
+  // dtor
+}
+
+Bool_t AliTRDTriggerAnalysis::CalcTriggers(const AliESDEvent *esdEvent)
+{
+  // evaluate the TRD trigger conditions,
+  // so far HCO, HSE, HQU, HJT, HEE
+
+  ResetTriggers();
+
+  if (!esdEvent) {
+    AliErrorClass("ESD event pointer is null");
+    return kFALSE;
+  }
+
+  TString trgClasses = esdEvent->GetFiredTriggerClasses();
+  // UInt_t  trgInputs  = esdEvent->GetHeader()->GetL1TriggerInputs();
+
+  Int_t nTracks[90]      = { 0 }; // stack-wise counted number of tracks above pt threshold
+
+  Int_t nTrdTracks = esdEvent->GetNumberOfTrdTracks();
+
+  if (nTrdTracks > 0)
+    Fire(kHCO);
+
+  for (Int_t iTrack = 0; iTrack < nTrdTracks; ++iTrack) {
+    AliESDTrdTrack *trdTrack = esdEvent->GetTrdTrack(iTrack);
+    if (!trdTrack)
+      continue;
+
+    // ignore the track if it was not in time
+    // (if required)
+    if (fRequireInTime && !trdTrack->GetTrackInTime())
+      continue;
+
+    AliVTrack *match = trdTrack->GetTrackMatch();
+    AliDebug(2, Form("GTU track %2i with pt = %5.2f has match: %p (pt = %5.2f)",
+                    iTrack, trdTrack->Pt(), match, match ? match->Pt() : 0));
+
+    // ignore the track if it does not have a matched global track
+    // (if required)
+    if (fRequireMatch && !match)
+      continue;
+
+    Int_t globalStack = 5*trdTrack->GetSector() + trdTrack->GetStack();
+
+    // stack-wise counting of tracks above pt threshold for jet trigger
+    if (TMath::Abs(trdTrack->GetPt()) >= fTRDptHJT) {
+      ++nTracks[globalStack];
+    }
+
+    // ignore the track for the electron triggers
+    // if it does not have a matched global track
+    // (if required)
+    if (fRequireMatchElectron && !match)
+      continue;
+
+    if ((TMath::Abs(trdTrack->Pt()) > fTRDptHQU) && (trdTrack->GetPID() > fTRDpidHQU))
+      Fire(kHQU);
+
+    if ((TMath::Abs(trdTrack->Pt()) > fTRDptHSE) && (trdTrack->GetPID() > fTRDpidHSE))
+      Fire(kHSE);
+
+    if ((trdTrack->GetSector() >= fTRDminSectorHEE) && (trdTrack->GetSector() <= fTRDmaxSectorHEE) &&
+       (TMath::Abs(trdTrack->Pt()) > fTRDptHSE) && (trdTrack->GetPID() > fTRDpidHSE))
+      Fire(kHEE);
+  }
+
+  // check if HJT condition is fulfilled in any stack
+  for (Int_t iStack = 0; iStack < 90; ++iStack) {
+    if (nTracks[iStack] >= fTRDnHJT) {
+      Fire(kHJT);
+      break;
+    }
+  }
+
+  return kTRUE;
+}
diff --git a/ANALYSIS/AliTRDTriggerAnalysis.h b/ANALYSIS/AliTRDTriggerAnalysis.h
new file mode 100644 (file)
index 0000000..d5f19c0
--- /dev/null
@@ -0,0 +1,57 @@
+/* Copyright(c) 2013, ALICE Experiment at CERN, All rights reserved.      *
+ * See cxx source for full Copyright notice                               */
+
+// evaluate TRD trigger conditions,
+// potentially with hardened conditions to remove
+// triggers caused by conversions of low-pt photons
+// at large radii
+//
+// Author: Jochen Klein <jochen.klein@cern.ch>
+
+#ifndef ALITRDTRIGGERANALYSIS_H
+#define ALITRDTRIGGERANALYSIS_H
+
+class AliESDEvent;
+
+class AliTRDTriggerAnalysis : public TObject
+{
+public:
+  AliTRDTriggerAnalysis();
+  ~AliTRDTriggerAnalysis();
+
+  enum TRDTrigger_t { kHCO = 0, kHJT, kHSE, kHQU, kHEE };
+
+  void ResetTriggers() { fTriggerFlags = fTriggerInputs = fTriggerClasses = 0; }
+  Bool_t CalcTriggers(const AliESDEvent* esdEvent);
+
+  Bool_t IsFired(TRDTrigger_t trg) const { return (fTriggerFlags & (1 << trg)); }
+
+protected:
+  void Fire(TRDTrigger_t trg) { fTriggerFlags |= (1 << trg); }
+
+  // configuration
+  UChar_t fTriggerFlags;   // internal representation of trigger decisions
+  UChar_t fTriggerInputs;  // internal representation of trigger decisions
+  UChar_t fTriggerClasses; // internal representation of trigger decisions
+  Bool_t fRequireMatch;           // require a matched global track
+                          // for all conditions
+  Bool_t fRequireMatchElectron;        // require a matched global track
+                               // for the electron conditions
+  Bool_t fRequireInTime;       // require the tracks to be in time
+
+  // trigger thresholds
+  Float_t fTRDptHSE;            // pt threshold for HSE trigger
+  UChar_t fTRDpidHSE;           // PID threshold for HSE trigger
+  Float_t fTRDptHQU;            // pt threshold for HQU trigger
+  UChar_t fTRDpidHQU;           // PID threshold for HQU trigger
+  Float_t fTRDptHEE;            // pt threshold for HEE trigger
+  UChar_t fTRDpidHEE;           // PID threshold for HEE trigger
+  UChar_t fTRDminSectorHEE;     // min sector for HEE trigger
+  UChar_t fTRDmaxSectorHEE;     // max sector for HEE trigger
+  Float_t fTRDptHJT;            // pt threshold for HJT trigger
+  UChar_t fTRDnHJT;             // no of track threshold for HJT trigger
+
+  ClassDef(AliTRDTriggerAnalysis, 1);
+};
+
+#endif
index c22f7cb..95a1832 100644 (file)
@@ -41,6 +41,7 @@ set ( SRCS
     AliAnalysisTaskTagCreator.cxx 
     AliMultiEventInputHandler.cxx 
     AliTriggerAnalysis.cxx 
+    AliTRDTriggerAnalysis.cxx 
     AliPhysicsSelection.cxx 
     AliBackgroundSelection.cxx 
     AliPhysicsSelectionTask.cxx