27 #include "AliAODTrack.h"
37 using namespace PWG::EMCAL;
41 fSelectNonITSrefitTracks(kTRUE)
43 fHybridFilterBits[0] = -1;
44 fHybridFilterBits[1] = -1;
47 AliEmcalAODHybridTrackCuts::AliEmcalAODHybridTrackCuts(
const char *name):
49 fSelectNonITSrefitTracks(kTRUE)
55 AliAODTrack *aodtrack =
dynamic_cast<AliAODTrack *
>(o);
57 bool selectionresult = aodtrack->IsHybridGlobalConstrainedGlobal();
59 if((
fSelectNonITSrefitTracks ==
false) && (!(aodtrack->GetStatus() & AliVTrack::kITSrefit))) selectionresult =
false;
108 AliInfoStream() <<
"Running test for 2010 Definition with non-refit tracks" << std::endl;
109 AliAODTrack testCat1WithRefit, testCat2WithRefit, testCat2WithoutRefit, testNoHybrid;
110 testCat1WithRefit.SetIsHybridGlobalConstrainedGlobal();
111 testCat2WithRefit.SetIsHybridGlobalConstrainedGlobal();
112 testCat2WithoutRefit.SetIsHybridGlobalConstrainedGlobal();
113 testCat1WithRefit.SetStatus(AliVTrack::kITSrefit);
114 testCat2WithRefit.SetStatus(AliVTrack::kITSrefit);
115 testCat1WithRefit.SetFilterMap(BIT(8));
116 testCat2WithRefit.SetFilterMap(BIT(4));
117 testCat2WithoutRefit.SetFilterMap(BIT(4));
121 if(!result_cat1_wrefit){
122 AliErrorStream() <<
"Track CAT1 not selected as hybrid track" << std::endl;
127 AliErrorStream() <<
"Hybrid track information not found for track CAT1" << std::endl;
131 AliErrorStream() <<
"Track not selected as hybrid track CAT1: " << int(tracktype->GetHybridTrackType()) << std::endl;
138 if(!result_cat2_wrefit){
139 AliErrorStream() <<
"Track CAT2 not selected as hybrid track" << std::endl;
144 AliErrorStream() <<
"Hybrid track information not found for track CAT2" << std::endl;
148 AliErrorStream() <<
"Track not selected as hybrid track CAT2: " << int(tracktype->GetHybridTrackType()) << std::endl;
155 if(!result_cat2_worefit){
156 AliErrorStream() <<
"Track CAT3 not selected as hybrid track" << std::endl;
161 AliErrorStream() <<
"Hybrid track information not found for track CAT3" << std::endl;
165 AliErrorStream() <<
"Track not selected as hybrid track CAT3: " << int(tracktype->GetHybridTrackType()) << std::endl;
172 if(result_nohybrid || result_nohybrid.GetUserInfo()){
173 AliErrorStream() <<
"Non-hybrid track selected or user object attached " << std::endl;
177 return nfailure == 0;
181 AliInfoStream() <<
"Running test for 2010 Definition without non-refit tracks" << std::endl;
182 AliAODTrack testCat1WithRefit, testCat2WithRefit, testCat2WithoutRefit, testNoHybrid;
183 testCat1WithRefit.SetIsHybridGlobalConstrainedGlobal();
184 testCat2WithRefit.SetIsHybridGlobalConstrainedGlobal();
185 testCat2WithoutRefit.SetIsHybridGlobalConstrainedGlobal();
186 testCat1WithRefit.SetStatus(AliVTrack::kITSrefit);
187 testCat2WithRefit.SetStatus(AliVTrack::kITSrefit);
188 testCat1WithRefit.SetFilterMap(BIT(8));
189 testCat2WithRefit.SetFilterMap(BIT(4));
190 testCat2WithoutRefit.SetFilterMap(BIT(4));
194 if(!result_cat1_wrefit) {
195 AliErrorStream() <<
"Track CAT1 not selected as hybrid track" << std::endl;
200 AliErrorStream() <<
"Hybrid track information not found for track CAT1" << std::endl;
204 AliErrorStream() <<
"Track not selected as hybrid track CAT1: " << int(tracktype->GetHybridTrackType()) << std::endl;
211 if(!result_cat2_wrefit){
212 AliErrorStream() <<
"Track CAT2 not selected as hybrid track" << std::endl;
217 AliErrorStream() <<
"Hybrid track information not found for track CAT2" << std::endl;
221 AliErrorStream() <<
"Track not selected as hybrid track CAT2: " << int(tracktype->GetHybridTrackType()) << std::endl;
228 if(result_cat2_worefit || result_cat2_worefit.GetUserInfo()) {
229 AliErrorStream() <<
"Non-refit track selected or user object attached " << std::endl;
234 if(result_nohybrid || result_nohybrid.GetUserInfo()){
235 AliErrorStream() <<
"Non-hybrid track selected or user object attached " << std::endl;
239 return nfailure == 0;
243 AliInfoStream() <<
"Running test for 2011 Definition" << std::endl;
244 AliAODTrack testCat1, testCat2, testNoHybrid;
245 testCat1.SetIsHybridGlobalConstrainedGlobal(kTRUE);
246 testCat2.SetIsHybridGlobalConstrainedGlobal(kTRUE);
247 testCat1.SetStatus(AliVTrack::kITSrefit);
248 testCat2.SetStatus(AliVTrack::kITSrefit);
249 testCat1.SetFilterMap(BIT(8));
250 testCat2.SetFilterMap(BIT(9));
256 AliErrorStream() <<
"Track CAT1 not selected as hybrid track" << std::endl;
261 AliErrorStream() <<
"Hybrid track information not found for track CAT1" << std::endl;
265 AliErrorStream() <<
"Track not selected as hybrid track CAT1: " << int(tracktype->GetHybridTrackType()) << std::endl;
273 AliErrorStream() <<
"Track CAT2 not selected as hybrid track" << std::endl;
278 AliErrorStream() <<
"Hybrid track information not found for track CAT2" << std::endl;
282 AliErrorStream() <<
"Track not selected as hybrid track CAT2: " << int(tracktype->GetHybridTrackType()) << std::endl;
289 if(result_nohybrid || result_nohybrid.GetUserInfo()){
290 AliErrorStream() <<
"Non-hybrid track selected or user object attached " << std::endl;
294 return nfailure == 0;
AliEmcalAODHybridTrackCuts * fDef2010woRefit
Hybrid track definition from 2010 excluding non-refit tracks.
AliEmcalAODHybridTrackCuts * fDef2011
Hybrid track definition from 2011 e.
bool TestDef2010wRefit() const
Test for hybrid tracks according to the 2010 definition including non-refit tracks.
TestAliEmcalAODHybridTrackCuts()
void Init()
Initializing track selection objects.
Structure containing the result of a given track selection step.
AliEmcalAODHybridTrackCuts * fDef2010wRefit
Hybrid track definition from 2010 including non-refit tracks.
void SetSelectNonITSrefitTracks(bool doReject)
Switch on/off selection of hybrid tracks without ITSrefit.
virtual ~TestAliEmcalAODHybridTrackCuts()
Destructor.
bool TestDef2011() const
Test for hybrid tracks according to the 2011 definition.
void SetHybridFilterBits(Int_t globalfilterbit, Int_t constrainedfilterbit)
Set the filterbits used to distinguish the different hybrid track types.
bool TestDef2010woRefit() const
Test for hybrid tracks according to the 2010 definition excluding non-refit tracks.
Cut class selecting hybrid tracks using the IsHybrid function.
void SetUserInfo(TObject *userinfo)
Bool_t fSelectNonITSrefitTracks
Select non-refit tracks.
Int_t fHybridFilterBits[2]
Bit numbers for various hybrid filter bits.
bool RunAllTests() const
Run all unit tests for the class AliEmcalAODHybridTrackCuts.
Interface for a cut class returning selection status and user information.
virtual AliEmcalTrackSelResultPtr IsSelected(TObject *o)
Run track selection of hybrid tracks.