]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.cxx
Making the directory structure of AliFemto flat. All files go into one common directory
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / AliFemtoEventReaderESDChain.cxx
similarity index 86%
rename from PWG2/FEMTOSCOPY/AliFemto/Reader/AliFemtoEventReaderESDChain.cxx
rename to PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.cxx
index 903bfc615b4347a6159eae2c347ab7fed7eef6b1..807740257a28ba1c25ceaeedb4cda0c648e57acb 100644 (file)
@@ -1,3 +1,11 @@
+////////////////////////////////////////////////////////////////////////////////
+///                                                                          ///
+/// AliFemtoEventReaderESDChain - the reader class for the Alice ESD         ///
+/// tailored for the Task framework                                 ///
+/// Reads in AliESDfriend to create shared hit/quality information           ///
+/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu                           ///
+///                                                                          ///
+////////////////////////////////////////////////////////////////////////////////
 #include "AliFemtoEventReaderESDChain.h"
 
 #include "TFile.h"
 #include "AliESD.h"
 #include "AliESDtrack.h"
 
-#include "Infrastructure/AliFmPhysicalHelixD.h"
-#include "Infrastructure/AliFmThreeVectorF.h"
+#include "AliFmPhysicalHelixD.h"
+#include "AliFmThreeVectorF.h"
 
-#include "Base/SystemOfUnits.h"
+#include "SystemOfUnits.h"
 
-#include "Infrastructure/AliFemtoEvent.h"
+#include "AliFemtoEvent.h"
 
 ClassImp(AliFemtoEventReaderESDChain)
 
@@ -20,7 +28,6 @@ ClassImp(AliFemtoEventReaderESDChain)
 
 using namespace std;
 //____________________________
-//constructor with 0 parameters , look at default settings 
 AliFemtoEventReaderESDChain::AliFemtoEventReaderESDChain():
   fFileName(" "),
   fConstrained(true),
@@ -32,6 +39,7 @@ AliFemtoEventReaderESDChain::AliFemtoEventReaderESDChain():
   fSharedList(0x0),
   fClusterPerPadrow(0x0)
 {
+  //constructor with 0 parameters , look at default settings 
   fClusterPerPadrow = (list<Int_t> **) malloc(sizeof(list<Int_t> *) * AliESDfriendTrack::kMaxTPCcluster);
   for (int tPad=0; tPad<AliESDfriendTrack::kMaxTPCcluster; tPad++) {
     fClusterPerPadrow[tPad] = new list<Int_t>();
@@ -43,7 +51,6 @@ AliFemtoEventReaderESDChain::AliFemtoEventReaderESDChain():
 }
 
 //__________________
-// Copy constructor
 AliFemtoEventReaderESDChain::AliFemtoEventReaderESDChain(const AliFemtoEventReaderESDChain& aReader):
   fFileName(" "),
   fConstrained(true),
@@ -55,11 +62,12 @@ AliFemtoEventReaderESDChain::AliFemtoEventReaderESDChain(const AliFemtoEventRead
   fSharedList(0x0),
   fClusterPerPadrow(0x0)
 {
+  // Copy constructor
   fConstrained = aReader.fConstrained;
   fNumberofEvent = aReader.fNumberofEvent;
   fCurEvent = aReader.fCurEvent;
   fCurFile = aReader.fCurFile;
-  //fEvent = new AliESD(*aReader.fEvent);
+  //  fEvent = new AliESD(*aReader.fEvent);
   fEvent = new AliESD();
   fEventFriend = aReader.fEventFriend;
   fClusterPerPadrow = (list<Int_t> **) malloc(sizeof(list<Int_t> *) * AliESDfriendTrack::kMaxTPCcluster);
@@ -80,9 +88,9 @@ AliFemtoEventReaderESDChain::AliFemtoEventReaderESDChain(const AliFemtoEventRead
   }
 }
 //__________________
-//Destructor
 AliFemtoEventReaderESDChain::~AliFemtoEventReaderESDChain()
 {
+  //Destructor
   delete fEvent;
 
   for (int tPad=0; tPad<AliESDfriendTrack::kMaxTPCcluster; tPad++) {
@@ -98,9 +106,9 @@ AliFemtoEventReaderESDChain::~AliFemtoEventReaderESDChain()
 }
 
 //__________________
-// Assignment operator
 AliFemtoEventReaderESDChain& AliFemtoEventReaderESDChain::operator=(const AliFemtoEventReaderESDChain& aReader)
 {
+  // Assignment operator
   if (this == &aReader)
     return *this;
 
@@ -109,8 +117,7 @@ AliFemtoEventReaderESDChain& AliFemtoEventReaderESDChain::operator=(const AliFem
   fCurEvent = aReader.fCurEvent;
   fCurFile = aReader.fCurFile;
   if (fEvent) delete fEvent;
-  //fEvent = new AliESD(*aReader.fEvent);
-  fEvent = new AliESD();
+  fEvent = new AliESD(*aReader.fEvent);
 
   fEventFriend = aReader.fEventFriend;
   
@@ -158,15 +165,15 @@ AliFemtoString AliFemtoEventReaderESDChain::Report()
 }
 
 //__________________
-// Select whether to read constrained or not constrained momentum
 void AliFemtoEventReaderESDChain::SetConstrained(const bool constrained)
 {
+  // Select whether to read constrained or not constrained momentum
   fConstrained=constrained;
 }
 //__________________
-// Check whether we read constrained or not constrained momentum
 bool AliFemtoEventReaderESDChain::GetConstrained() const
 {
+  // Check whether we read constrained or not constrained momentum
   return fConstrained;
 }
 //__________________
@@ -181,7 +188,7 @@ AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent()
   // Get the friend information
   cout<<"starting to read event "<<fCurEvent<<endl;
   fEvent->SetESDfriend(fEventFriend);
-  vector<int> label_table;//to check labels
+  vector<int> tLabelTable;//to check labels
        
   hbtEvent = new AliFemtoEvent;
   //setting basic things
@@ -242,7 +249,7 @@ AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent()
 
   for (int i=0;i<nofTracks;i++)
     {
-      bool  good_momentum=true; //flaga to chcek if we can read momentum of this track
+      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
@@ -263,9 +270,9 @@ AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent()
                                                
       double pxyz[3];
       if (fConstrained==true)              
-       good_momentum=esdtrack->GetConstrainedPxPyPz(pxyz); //reading constrained momentum
+       tGoodMomentum=esdtrack->GetConstrainedPxPyPz(pxyz); //reading constrained momentum
       else
-       good_momentum=esdtrack->GetPxPyPz(pxyz);//reading noconstarined momentum
+       tGoodMomentum=esdtrack->GetPxPyPz(pxyz);//reading noconstarined momentum
 
       AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]);
       if (v.mag() == 0) {
@@ -275,10 +282,10 @@ AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent()
       }
       trackCopy->SetP(v);//setting momentum
       trackCopy->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1]));
-      const AliFmThreeVectorD p(pxyz[0],pxyz[1],pxyz[2]);
-      const AliFmThreeVectorD origin(fV1[0],fV1[1],fV1[2]);
+      const AliFmThreeVectorD kP(pxyz[0],pxyz[1],pxyz[2]);
+      const AliFmThreeVectorD kOrigin(fV1[0],fV1[1],fV1[2]);
       //setting helix I do not if it is ok
-      AliFmPhysicalHelixD helix(p,origin,(double)(fEvent->GetMagneticField())*kilogauss,(double)(trackCopy->Charge())); 
+      AliFmPhysicalHelixD helix(kP,kOrigin,(double)(fEvent->GetMagneticField())*kilogauss,(double)(trackCopy->Charge())); 
       trackCopy->SetHelix(helix);
                
       trackCopy->SetTrackId(esdtrack->GetID());
@@ -330,7 +337,7 @@ AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent()
        }
       }
 
-      if (good_momentum==true)
+      if (tGoodMomentum==true)
        {
          hbtEvent->TrackCollection()->push_back(trackCopy);//adding track to analysis
          realnofTracks++;//real number of tracks
@@ -349,17 +356,17 @@ AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent()
   return hbtEvent; 
 }
 //___________________
-// The chain loads the ESD for us
-// You must provide the address where it can be found
 void AliFemtoEventReaderESDChain::SetESDSource(AliESD *aESD)
 {
+  // The chain loads the ESD for us
+  // You must provide the address where it can be found
   fEvent = aESD;
 }
 //___________________
-// We need the ESD tree to obtain
-// information about the friend file location
 void AliFemtoEventReaderESDChain::SetESDfriendSource(AliESDfriend *aFriend)
 {
+  // We need the ESD tree to obtain
+  // information about the friend file location
   fEventFriend = aFriend;
 }