fNumberofEvent(0),
fCurEvent(0),
fCurFile(0),
- fEvent(0x0)
+ fEvent(0x0),
+ fUsePhysicsSel(kFALSE),
+ fSelect(0x0),
+ fTrackType(kGlobal)
{
//constructor with 0 parameters , look at default settings
// fClusterPerPadrow = (list<Int_t> **) malloc(sizeof(list<Int_t> *) * AliESDfriendTrack::kMaxTPCcluster);
fNumberofEvent(0),
fCurEvent(0),
fCurFile(0),
- fEvent(0x0)
+ fEvent(0x0),
+ fUsePhysicsSel(kFALSE),
+ fSelect(0x0),
+ fTrackType(kGlobal)
{
// Copy constructor
fConstrained = aReader.fConstrained;
fCurFile = aReader.fCurFile;
// fEvent = new AliESD(*aReader.fEvent);
fEvent = new AliESDEvent();
+ fUsePhysicsSel = aReader.fUsePhysicsSel;
+ if (aReader.fUsePhysicsSel)
+ fSelect = new AliPhysicsSelection();
+ fTrackType = aReader.fTrackType;
// fEventFriend = aReader.fEventFriend;
// fClusterPerPadrow = (list<Int_t> **) malloc(sizeof(list<Int_t> *) * AliESDfriendTrack::kMaxTPCcluster);
// for (int tPad=0; tPad<AliESDfriendTrack::kMaxTPCcluster; tPad++) {
// delete fSharedList[tPad];
// }
// delete [] fSharedList;
+ if (fSelect) delete fSelect;
}
//__________________
fCurFile = aReader.fCurFile;
if (fEvent) delete fEvent;
fEvent = new AliESDEvent();
+ fTrackType = aReader.fTrackType;
+ fUsePhysicsSel = aReader.fUsePhysicsSel;
+ if (aReader.fUsePhysicsSel)
+ fSelect = new AliPhysicsSelection();
// fEventFriend = aReader.fEventFriend;
// if (fClusterPerPadrow) {
return fUseTPCOnly;
}
+void AliFemtoEventReaderESDChain::SetUsePhysicsSelection(const bool usephysics)
+{
+ fUsePhysicsSel = usephysics;
+ if (!fSelect) fSelect = new AliPhysicsSelection();
+}
+
AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent()
{
// Get the event, read all the relevant information
cout<<"starting to read event "<<fCurEvent<<endl;
// fEvent->SetESDfriend(fEventFriend);
if(fEvent->GetAliESDOld())fEvent->CopyFromOldESD();
-
+
hbtEvent = new AliFemtoEvent;
+
+ if (fUsePhysicsSel) {
+ hbtEvent->SetIsCollisionCandidate(fSelect->IsCollisionCandidate(fEvent));
+ if (!(fSelect->IsCollisionCandidate(fEvent)))
+ printf("Event not a collision candidate\n");
+ }
+ else
+ hbtEvent->SetIsCollisionCandidate(kTRUE);
+
//setting basic things
// hbtEvent->SetEventNumber(fEvent->GetEventNumber());
hbtEvent->SetRunNumber(fEvent->GetRunNumber());
{
bool tGoodMomentum=true; //flaga to chcek if we can read momentum of this track
- AliFemtoTrack* trackCopy = new AliFemtoTrack();
const AliESDtrack *esdtrack=fEvent->GetTrack(i);//getting next track
// const AliESDfriendTrack *tESDfriendTrack = esdtrack->GetFriendTrack();
+ // If reading ITS-only tracks, reject all with TPC
+ if (fTrackType == kITSOnly) {
+ if (esdtrack->GetStatus() & AliESDtrack::kTPCrefit) continue;
+ if (!(esdtrack->GetStatus() & AliESDtrack::kITSrefit)) continue;
+ if (esdtrack->GetStatus() & AliESDtrack::kTPCin) continue;
+ UChar_t iclm = esdtrack->GetITSClusterMap();
+ Int_t incls = 0;
+ for (int iter=0; iter<6; iter++) if (iclm&(1<<iter)) incls++;
+ if (incls<=3) {
+ cout << "Rejecting track with " << incls << " clusters" << endl;
+ continue;
+ }
+ }
+
+ AliFemtoTrack* trackCopy = new AliFemtoTrack();
trackCopy->SetCharge((short)esdtrack->GetSign());
//in aliroot we have AliPID
return d;
}
+void AliFemtoEventReaderESDChain::SetReadTrackType(ReadTrackType aType)
+{
+ fTrackType = aType;
+}