]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add event vertex position reading
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Jun 2008 13:00:49 +0000 (13:00 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Jun 2008 13:00:49 +0000 (13:00 +0000)
PWG2/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.cxx
PWG2/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.h
PWG2/FEMTOSCOPY/AliFemto/AliFemtoEvent.cxx
PWG2/FEMTOSCOPY/AliFemto/AliFemtoEvent.h
PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.cxx
PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChainKine.cxx

index 18bf7d2491a9c47fc902b91c788913d7a9a82f69..f636edde80f12e39210e98b6dee08b4c2dd94eb6 100644 (file)
@@ -13,9 +13,18 @@ ClassImp(AliFemtoBasicEventCut)
 #endif
 
 AliFemtoBasicEventCut::AliFemtoBasicEventCut() :
-  fNEventsPassed(0), fNEventsFailed(0)
+  AliFemtoEventCut(),
+  fEventMult(),
+  fVertZPos(),
+  fAcceptBadVertex(false), 
+  fNEventsPassed(0), 
+  fNEventsFailed(0)
 {
   // Default constructor
+  fEventMult[0] = 0;
+  fEventMult[1] = 100000;
+  fVertZPos[0] = -100.0;
+  fVertZPos[1] = 100.0;
 } 
 //------------------------------
 AliFemtoBasicEventCut::~AliFemtoBasicEventCut(){
@@ -33,7 +42,8 @@ bool AliFemtoBasicEventCut::Pass(const AliFemtoEvent* event){
     ((mult > fEventMult[0]) && 
      (mult < fEventMult[1]) && 
      (vertexZPos > fVertZPos[0]) &&
-     (vertexZPos < fVertZPos[1]));
+     (vertexZPos < fVertZPos[1]) &&
+     (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)));
   goodEvent ? fNEventsPassed++ : fNEventsFailed++ ;
   cout << "AliFemtoBasicEventCut:: return : " << goodEvent << endl;
   return (goodEvent);
@@ -52,3 +62,11 @@ AliFemtoString AliFemtoBasicEventCut::Report(){
   AliFemtoString returnThis = stemp;
   return returnThis;
 }
+void AliFemtoBasicEventCut::SetAcceptBadVertex(bool b)
+{
+  fAcceptBadVertex = b;
+}
+bool AliFemtoBasicEventCut::GetAcceptBadVertex()
+{
+  return fAcceptBadVertex;
+}
index 5dabd214958f5e39c72498c9627bf470477a5e4c..9a2a4c2a73b56071a132eb753664a776373b73e5 100644 (file)
@@ -25,8 +25,10 @@ public:
 
   void SetEventMult(const int& lo,const int& hi);
   void SetVertZPos(const float& lo, const float& hi);
+  void SetAcceptBadVertex(bool b);
   int NEventsPassed() const;
   int NEventsFailed() const;
+  bool GetAcceptBadVertex();
 
   virtual AliFemtoString Report();
   virtual bool Pass(const AliFemtoEvent* event);
@@ -37,7 +39,7 @@ private:   // here are the quantities I want to cut on...
 
   int fEventMult[2];      // range of multiplicity
   float fVertZPos[2];     // range of z-position of vertex
-
+  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
 
index 756e5f2b6baf694460d97f7c51428d487e339176..a7c26bfe7d411856cdbd3c386e4d09d9bdab7bd9 100644 (file)
@@ -30,6 +30,7 @@ AliFemtoEvent::AliFemtoEvent():
   fNumberOfTracks(0),
   fMagneticField(0),
   fPrimVertPos(0,0,0),
+  fPrimVertCov(),
   fTrackCollection(0),
   fV0Collection(0),
   fXiCollection(0),
@@ -47,6 +48,12 @@ AliFemtoEvent::AliFemtoEvent():
   fPrimVertPos[0]=-999.0;
   fPrimVertPos[1]=-999.0;
   fPrimVertPos[2]=-999.0;
+  fPrimVertCov[0]=0.000000000001;
+  fPrimVertCov[1]=0.000000000001;
+  fPrimVertCov[2]=0.000000000001;
+  fPrimVertCov[3]=0.000000000001;
+  fPrimVertCov[4]=0.000000000001;
+  fPrimVertCov[5]=0.000000000001;
   fTrackCollection = new AliFemtoTrackCollection;
   fV0Collection = new AliFemtoV0Collection;
   fXiCollection = new AliFemtoXiCollection;
@@ -60,6 +67,7 @@ AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev, AliFemtoTrackCut* tCut, Al
   fNumberOfTracks(0),
   fMagneticField(0),
   fPrimVertPos(0,0,0),
+  fPrimVertCov(),
   fTrackCollection(0),
   fV0Collection(0),
   fXiCollection(0),
@@ -77,6 +85,8 @@ AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev, AliFemtoTrackCut* tCut, Al
   fEventNumber = ev.fEventNumber;
   fRunNumber = ev.fRunNumber;
   
+  SetPrimVertCov(ev.PrimVertCov());
+
   fZDCN1Energy=ev.fZDCN1Energy;     
   fZDCP1Energy=ev.fZDCP1Energy;      
   fZDCN2Energy=ev.fZDCN2Energy;      
@@ -130,6 +140,7 @@ AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev):
   fNumberOfTracks(0),
   fMagneticField(0),
   fPrimVertPos(0,0,0),
+  fPrimVertCov(),
   fTrackCollection(0),
   fV0Collection(0),
   fXiCollection(0),
@@ -147,6 +158,8 @@ AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev):
   fEventNumber = ev.fEventNumber;
   fRunNumber = ev.fRunNumber;
   
+  SetPrimVertCov(ev.PrimVertCov());
+
   fZDCN1Energy=ev.fZDCN1Energy;     
   fZDCP1Energy=ev.fZDCP1Energy;      
   fZDCN2Energy=ev.fZDCN2Energy;      
@@ -286,6 +299,14 @@ void AliFemtoEvent::SetNumberOfTracks(const unsigned short& tracks){fNumberOfTra
 
 
 void AliFemtoEvent::SetPrimVertPos(const AliFemtoThreeVector& vp){fPrimVertPos = vp;}
+void AliFemtoEvent::SetPrimVertCov(const double* v){
+  fPrimVertCov[0] = v[0];
+  fPrimVertCov[1] = v[1];
+  fPrimVertCov[2] = v[2];
+  fPrimVertCov[3] = v[3];
+  fPrimVertCov[4] = v[4];
+  fPrimVertCov[5] = v[5];
+}
 void AliFemtoEvent::SetMagneticField(const double& magF){fMagneticField = magF;}
 
 void AliFemtoEvent::SetTriggerMask(const unsigned long int& aTriggerMask) {fTriggerMask=aTriggerMask;}
@@ -304,6 +325,7 @@ AliFemtoXiCollection* AliFemtoEvent::XiCollection() const {return fXiCollection;
 AliFemtoKinkCollection* AliFemtoEvent::KinkCollection() const {return fKinkCollection;}
 AliFemtoTrackCollection* AliFemtoEvent::TrackCollection() const {return fTrackCollection;}
 AliFemtoThreeVector AliFemtoEvent::PrimVertPos() const {return fPrimVertPos;}
+const double* AliFemtoEvent::PrimVertCov() const {return fPrimVertCov;}
 double AliFemtoEvent::MagneticField() const {return fMagneticField;}
 unsigned long int AliFemtoEvent::TriggerMask() const {return fTriggerMask;}
 unsigned char AliFemtoEvent::TriggerCluster() const {return fTriggerCluster;}
index 7f7003934a26d62e9320cbe4a925e36bb3f20840..455dd3068dccbc45ef876e4df348811170d28b86 100644 (file)
@@ -49,6 +49,7 @@ public:
   int RunNumber() const;
   unsigned short NumberOfTracks() const;
   AliFemtoThreeVector PrimVertPos() const;
+  const double* PrimVertCov() const;
   AliFemtoV0Collection* V0Collection() const;
   AliFemtoXiCollection* XiCollection() const;
   AliFemtoKinkCollection* KinkCollection() const;
@@ -70,6 +71,7 @@ public:
   void SetRunNumber(const int& i);
   void SetNumberOfTracks(const unsigned short& s);
   void SetPrimVertPos(const AliFemtoThreeVector& v);
+  void SetPrimVertCov(const double* v);
   void SetMagneticField(const double& x);
   
    //functions for alice variables
@@ -93,6 +95,7 @@ private:
   double fMagneticField;                 // magnetic field in Z direction
 
   AliFemtoThreeVector fPrimVertPos;      // primary vertex position
+  double fPrimVertCov[6];                // primary vertex covariances
   AliFemtoTrackCollection* fTrackCollection; // collection of tracks
   AliFemtoV0Collection* fV0Collection;   // collection of V0s
   AliFemtoXiCollection* fXiCollection;   // collection of Xis
index 149ab100f46633ca9ff901247e007aa72f35cae7..4bbf6696f58c678134f0f54808482aafa3bfb959 100644 (file)
@@ -232,15 +232,23 @@ AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent()
        
   //Vertex
   double fV1[3];
+  double fVCov[6];
   if (fUseTPCOnly) {
     fEvent->GetPrimaryVertexTPC()->GetXYZ(fV1);
+    fEvent->GetPrimaryVertexTPC()->GetCovMatrix(fVCov);
+    if (!fEvent->GetPrimaryVertexTPC()->GetStatus())
+      fVCov[4] = -1001.0;
   }
   else {
     fEvent->GetPrimaryVertex()->GetXYZ(fV1);
+    fEvent->GetPrimaryVertex()->GetCovMatrix(fVCov);
+    if (!fEvent->GetPrimaryVertex()->GetStatus())
+      fVCov[4] = -1001.0;
   }
 
   AliFmThreeVectorF vertex(fV1[0],fV1[1],fV1[2]);
   hbtEvent->SetPrimVertPos(vertex);
+  hbtEvent->SetPrimVertCov(fVCov);
        
   //starting to reading tracks
   int nofTracks=0;  //number of reconstructed tracks in event
index 96605c9c489da4c1c595c5539b1bc5b224047be6..b0ce8f04406784be45cb3c04ef06bd85c661f7d5 100644 (file)
@@ -145,15 +145,24 @@ AliFemtoEvent* AliFemtoEventReaderESDChainKine::ReturnHbtEvent()
        
   //Vertex
   double fV1[3];
+  double fVCov[6];
   if (fUseTPCOnly) {
     fEvent->GetPrimaryVertexTPC()->GetXYZ(fV1);
+    fEvent->GetPrimaryVertexTPC()->GetCovMatrix(fVCov);
+    if (!fEvent->GetPrimaryVertexTPC()->GetStatus())
+      fVCov[4] = -1001.0;
   }
   else {
     fEvent->GetPrimaryVertex()->GetXYZ(fV1);
+    fEvent->GetPrimaryVertex()->GetCovMatrix(fVCov);
+    if (!fEvent->GetPrimaryVertex()->GetStatus())
+      fVCov[4] = -1001.0;
   }
 
   AliFmThreeVectorF vertex(fV1[0],fV1[1],fV1[2]);
+  
   hbtEvent->SetPrimVertPos(vertex);
+  hbtEvent->SetPrimVertCov(fVCov);
 
   AliGenHijingEventHeader *hdh = dynamic_cast<AliGenHijingEventHeader *> (fGenHeader);