fEventMult(),
fVertZPos(),
fAcceptBadVertex(false),
+ fAcceptOnlyPhysics(true),
fNEventsPassed(0),
fNEventsFailed(0)
{
(mult <= fEventMult[1]) &&
(vertexZPos > fVertZPos[0]) &&
(vertexZPos < fVertZPos[1]) &&
- (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)));
+ (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)) &&
+ ((!fAcceptOnlyPhysics) || (event->IsCollisionCandidate())));
goodEvent ? fNEventsPassed++ : fNEventsFailed++ ;
// cout << "AliFemtoBasicEventCut:: return : " << goodEvent << endl;
return (goodEvent);
{
return fAcceptBadVertex;
}
+void AliFemtoBasicEventCut::SetAcceptOnlyPhysics(bool b)
+{
+ fAcceptOnlyPhysics = b;
+}
+bool AliFemtoBasicEventCut::GetAcceptOnlyPhysics()
+{
+ return fAcceptOnlyPhysics;
+}
void SetEventMult(const int& lo,const int& hi);
void SetVertZPos(const float& lo, const float& hi);
void SetAcceptBadVertex(bool b);
+ void SetAcceptOnlyPhysics(bool b);
int NEventsPassed() const;
int NEventsFailed() const;
bool GetAcceptBadVertex();
+ bool GetAcceptOnlyPhysics();
virtual AliFemtoString Report();
virtual bool Pass(const AliFemtoEvent* event);
bool fAcceptBadVertex; // Set to true to accept events with bad vertex
long fNEventsPassed; // Number of events checked by this cut that passed
long fNEventsFailed; // Number of events checked by this cut that failed
+ bool fAcceptOnlyPhysics;// Accept only physics events
#ifdef __ROOT__
ClassDef(AliFemtoBasicEventCut, 1)
#include <TList.h>
AliFemtoCutMonitorEventMult::AliFemtoCutMonitorEventMult():
- fEvMult(0)
+ fEvMult(0),
+ fNormEvMult(0)
{
// Default constructor
fEvMult = new TH1D("EvMult", "Event Multiplicity", 5001, -0.5, 5000.5);
AliFemtoCutMonitorEventMult::AliFemtoCutMonitorEventMult(const char *aName):
AliFemtoCutMonitor(),
- fEvMult(0)
+ fEvMult(0),
+ fNormEvMult(0)
{
// Normal constructor
char name[200];
snprintf(name, 200, "EvMult%s", aName);
fEvMult = new TH1D(name, "Event Multiplicity", 5001, -0.5, 5000.5);
+
+ snprintf(name, 200, "NormEvMult%s", aName);
+ fNormEvMult = new TH1D(name, "Normalized Event Multiplicity", 5001, -0.5, 5000.5);
}
AliFemtoCutMonitorEventMult::AliFemtoCutMonitorEventMult(const AliFemtoCutMonitorEventMult &aCut):
AliFemtoCutMonitor(),
- fEvMult(0)
+ fEvMult(0),
+ fNormEvMult(0)
{
// copy constructor
if (fEvMult) delete fEvMult;
fEvMult = new TH1D(*aCut.fEvMult);
+
+ if (fNormEvMult) delete fNormEvMult;
+ fNormEvMult = new TH1D(*aCut.fNormEvMult);
}
AliFemtoCutMonitorEventMult::~AliFemtoCutMonitorEventMult()
{
// Destructor
delete fEvMult;
+ delete fNormEvMult;
}
AliFemtoCutMonitorEventMult& AliFemtoCutMonitorEventMult::operator=(const AliFemtoCutMonitorEventMult& aCut)
if (fEvMult) delete fEvMult;
fEvMult = new TH1D(*aCut.fEvMult);
+ if (fNormEvMult) delete fNormEvMult;
+ fNormEvMult = new TH1D(*aCut.fNormEvMult);
+
return *this;
}
{
// Fill in the monitor histograms with the values from the current track
fEvMult->Fill(aEvent->NumberOfTracks());
+ fNormEvMult->Fill(aEvent->UncorrectedNumberOfPrimaries());
}
void AliFemtoCutMonitorEventMult::Write()
{
// Write out the relevant histograms
fEvMult->Write();
+ fNormEvMult->Write();
}
TList *AliFemtoCutMonitorEventMult::GetOutputList()
{
TList *tOutputList = new TList();
tOutputList->Add(fEvMult);
+ tOutputList->Add(fNormEvMult);
return tOutputList;
}
class AliFemtoCutMonitorEventMult : public AliFemtoCutMonitor{
-public:
+ public:
AliFemtoCutMonitorEventMult();
AliFemtoCutMonitorEventMult(const char *aName);
AliFemtoCutMonitorEventMult(const AliFemtoCutMonitorEventMult &aCut);
virtual TList *GetOutputList();
-private:
- TH1D *fEvMult; // Multiplicity distribution
+ private:
+ TH1D *fEvMult; // Multiplicity distribution
+ TH1D *fNormEvMult; // Normalized event multiplicity distribution
};
#endif
fRunNumber(0),
fNumberOfTracks(0),
fMagneticField(0),
+ fIsCollisionCandidate(kTRUE),
fPrimVertPos(0,0,0),
fPrimVertCov(),
fTrackCollection(0),
fRunNumber(0),
fNumberOfTracks(0),
fMagneticField(0),
+ fIsCollisionCandidate(kTRUE),
fPrimVertPos(0,0,0),
fPrimVertCov(),
fTrackCollection(0),
fZDCParticipants=ev.fZDCParticipants;
fNumberOfTracks = ev.fNumberOfTracks;
fMagneticField= ev.fMagneticField;
-
+ fIsCollisionCandidate = ev.fIsCollisionCandidate;
+
fTriggerMask=ev.fTriggerMask; // Trigger Type (mask)
fTriggerCluster=ev.fTriggerCluster;
fReactionPlaneAngle=ev.fReactionPlaneAngle;
fRunNumber(0),
fNumberOfTracks(0),
fMagneticField(0),
+ fIsCollisionCandidate(kTRUE),
fPrimVertPos(0,0,0),
fPrimVertCov(),
fTrackCollection(0),
fZDCParticipants=ev.fZDCParticipants;
fNumberOfTracks = ev.fNumberOfTracks;
fMagneticField= ev.fMagneticField;
-
+ fIsCollisionCandidate = ev.fIsCollisionCandidate;
fTriggerMask=ev.fTriggerMask; // Trigger Type (mask)
fTriggerCluster=ev.fTriggerCluster;
fReactionPlaneAngle=ev.fReactionPlaneAngle;
fZDCParticipants=aEvent.fZDCParticipants;
fNumberOfTracks = aEvent.fNumberOfTracks;
fMagneticField= aEvent.fMagneticField;
-
+ fIsCollisionCandidate = aEvent.fIsCollisionCandidate;
+
fTriggerMask=aEvent.fTriggerMask; // Trigger Type (mask)
fTriggerCluster=aEvent.fTriggerCluster;
fReactionPlaneAngle=aEvent.fReactionPlaneAngle;
fPrimVertCov[5] = v[5];
}
void AliFemtoEvent::SetMagneticField(const double& magF){fMagneticField = magF;}
+void AliFemtoEvent::SetIsCollisionCandidate(const bool& is){fIsCollisionCandidate = is;}
void AliFemtoEvent::SetTriggerMask(const unsigned long int& aTriggerMask) {fTriggerMask=aTriggerMask;}
void AliFemtoEvent::SetTriggerCluster(const unsigned char& aTriggerCluster) {fTriggerCluster=aTriggerCluster;}
double AliFemtoEvent::MagneticField() const {return fMagneticField;}
unsigned long int AliFemtoEvent::TriggerMask() const {return fTriggerMask;}
unsigned char AliFemtoEvent::TriggerCluster() const {return fTriggerCluster;}
+bool AliFemtoEvent::IsCollisionCandidate() const {return fIsCollisionCandidate;}
float AliFemtoEvent::ZDCN1Energy() const {return fZDCN1Energy;}
double AliFemtoEvent::UncorrectedNumberOfPrimaries() const
{
- return NumberOfTracks();
+ // Count number of normalized charged tracks
+ Int_t tNormTrackCount = 0;
+ for (AliFemtoTrackIterator iter=fTrackCollection->begin();iter!=fTrackCollection->end();iter++){
+ if (!((*iter)->Flags()&(AliFemtoTrack::kTPCrefit))) continue;
+ if ((*iter)->TPCncls() < 50) continue;
+ if ((*iter)->TPCchi2()/(*iter)->TPCncls() > 60.0) continue;
+ if ((*iter)->ImpactD() > 6.0) continue;
+ if ((*iter)->ImpactZ() > 6.0) continue;
+ if (fabs((*iter)->P().pseudoRapidity()) > 0.9) continue;
+
+ tNormTrackCount++;
+ }
+
+ return tNormTrackCount;
+ // return NumberOfTracks();
}
AliFemtoKinkCollection* KinkCollection() const;
AliFemtoTrackCollection* TrackCollection() const;
double MagneticField() const;
+ bool IsCollisionCandidate() const;
//functions for alice variables
float ZDCN1Energy() const;
void SetPrimVertPos(const AliFemtoThreeVector& v);
void SetPrimVertCov(const double* v);
void SetMagneticField(const double& x);
-
+ void SetIsCollisionCandidate(const bool& is);
+
//functions for alice variables
void SetZDCN1Energy(const float& x);
void SetZDCP1Energy(const float& x);
unsigned short fRunNumber; // run number the event belong to
unsigned short fNumberOfTracks; // total number of TPC tracks
double fMagneticField; // magnetic field in Z direction
-
+ bool fIsCollisionCandidate; // is collision candidate
+
AliFemtoThreeVector fPrimVertPos; // primary vertex position
double fPrimVertCov[6]; // primary vertex covariances
AliFemtoTrackCollection* fTrackCollection; // collection of tracks
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;
+}
#include "TTree.h"
#include "AliESDEvent.h"
#include "AliESDfriend.h"
+#include "AliPhysicsSelection.h"
#include <list>
class AliFemtoEvent;
class AliFemtoEventReaderESDChain : public AliFemtoEventReader
{
public:
+ enum TrackType {kGlobal=0, kTPCOnly=1, kITSOnly=2, kSPDTracklet=3};
+ typedef enum TrackType ReadTrackType;
+
AliFemtoEventReaderESDChain();
AliFemtoEventReaderESDChain(const AliFemtoEventReaderESDChain& aReader);
~AliFemtoEventReaderESDChain();
void SetConstrained(const bool constrained);
void SetReadTPCInner(const bool readinner);
void SetUseTPCOnly(const bool usetpconly);
+ void SetUsePhysicsSelection(const bool usephysics);
bool GetConstrained() const;
bool GetReadTPCInner() const;
bool GetUseTPCOnly() const;
+
+ void SetReadTrackType(ReadTrackType aType);
void SetESDSource(AliESDEvent *aESD);
// void SetESDfriendSource(AliESDfriend *aFriend);
unsigned int fCurFile; //number of current file
AliESDEvent* fEvent; //ESD event
// AliESDfriend* fEventFriend;
+ bool fUsePhysicsSel; //if true the physics selection class will be used
+ AliPhysicsSelection *fSelect; //Class to select only physics events
+ ReadTrackType fTrackType; // Type of track read
/* list<Int_t> **fSharedList; //! Table (one list per padrow) of clusters which are shared */
/* list<Int_t> **fClusterPerPadrow; //! Table (one list per padrow) of clusters in each padrow */