AliPhysics  4a7363b (4a7363b)
AliEMCalTriggerExtraCuts.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2015, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
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  **************************************************************************/
15 #include <TMath.h>
16 
17 #include "AliAODTrack.h"
18 #include "AliESDtrack.h"
19 #include "AliExternalTrackParam.h"
20 #include "AliLog.h"
21 #include "AliVEvent.h"
22 #include "AliVTrack.h"
23 
25 
29 
30 namespace EMCalTriggerPtAnalysis {
31 
35 AliEMCalTriggerExtraCuts::AliEMCalTriggerExtraCuts() :
36  fMinCrossedRowsTPC(0),
37  fRequestBitmap(16)
38 {
39 }
40 
47  AliVTrack *rectrack(NULL);
48  if(!(rectrack = dynamic_cast<AliVTrack *>(o))){
49  AliError("Object not of type AliVTrack");
50  return false;
51  }
52  Bool_t isSelected(true);
53 
54  if(fRequestBitmap.TestBitNumber(kTPCCrossedRows)){
55  //test
56  Float_t ncrossed = GetTPCCrossedRows(rectrack);
57  AliDebug(2, Form("Crossed rows %f, min %d\n", ncrossed, fMinCrossedRowsTPC));
58  if(ncrossed < fMinCrossedRowsTPC)
59  isSelected = false;
60  AliDebug(1, Form("Selected : %s", isSelected ? "Yes" : "No"));
61  }
62 
63  if(fRequestBitmap.TestBitNumber(kTPCTrackLength)){
64  Double_t tracklength = CalculateTPCTrackLength(rectrack),
65  cut = 0.85*(130-5*TMath::Abs(1./rectrack->Pt()));
66  AliDebug(2, Form("track length %f, min %f\n", tracklength, cut));
67  if(tracklength < cut)
68  isSelected = false;
69  AliDebug(1, Form("Selected : %s", isSelected ? "Yes" : "No"));
70  }
71 
72  return isSelected;
73 }
74 
79 Float_t AliEMCalTriggerExtraCuts::GetTPCCrossedRows(const AliVTrack *const trk) const {
80  if(trk->IsA() == AliESDtrack::Class()){
81  return (static_cast<const AliESDtrack *>(trk))->GetTPCCrossedRows();
82  } else if(trk->IsA() == AliAODTrack::Class()){
83  return static_cast<Float_t>((static_cast<const AliAODTrack * >(trk))->GetTPCNCrossedRows());
84  }
85  return 0.;
86 }
87 
96  Double_t result = 0;
97  AliAODTrack *tr;
98  Short_t sign = trk->Charge();
99  Double_t xyz[50];
100  Double_t pxpypz[50];
101  Double_t cv[21];
102 
103  memset(cv, 0, sizeof(Double_t) * 21);
104  memset(pxpypz, 0, sizeof(Double_t) * 50);
105  memset(xyz, 0, sizeof(Double_t) * 50);
106 
107  Double_t bMagZ = trk->GetEvent()->GetMagneticField();
108 
109  trk->GetXYZ(xyz);
110  trk->GetPxPyPz(pxpypz);
111  trk->GetCovarianceXYZPxPyPz(cv);
112 
113  AliExternalTrackParam par(xyz, pxpypz, cv, sign);
114  result = AliESDtrack::GetLengthInActiveZone(&par,3,236, bMagZ ,0,0);
115  return result;
116 }
117 
118 } /* namespace EMCalTriggerPtAnalysis */
Int_t fMinCrossedRowsTPC
Min. number of crossed rows in the TPC.
double Double_t
Definition: External.C:58
Float_t GetTPCCrossedRows(const AliVTrack *const trk) const
Extra track selection cuts for the high- track analysis.
float Float_t
Definition: External.C:68
Declaration of class AliEMCalTriggerExtraCuts.
short Short_t
Definition: External.C:23
Analysis of high- tracks in triggered events.
bool Bool_t
Definition: External.C:53