]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.cxx
Making the directory structure of AliFemto flat. All files go into one common directory
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / AliFemtoEventReaderESD.cxx
similarity index 94%
rename from PWG2/FEMTOSCOPY/AliFemto/Reader/AliFemtoEventReaderESD.cxx
rename to PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.cxx
index 969b12252f37b17425a10f47675f5f5b6bc04944..6ff311c1179fd1803786a785331082dabcd6e5ae 100644 (file)
 
 //#include "TSystem.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(AliFemtoEventReaderESD)
 
@@ -65,6 +65,7 @@ AliFemtoEventReaderESD::AliFemtoEventReaderESD():
   fSharedList(0x0),
   fClusterPerPadrow(0x0)
 {
+  // default constructor
   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>();
@@ -90,6 +91,7 @@ AliFemtoEventReaderESD::AliFemtoEventReaderESD(const AliFemtoEventReaderESD &aRe
   fSharedList(0x0),
   fClusterPerPadrow(0x0)
 {
+  // copy constructor
   fInputFile = aReader.fInputFile;
   fFileName  = aReader.fFileName;
   fConstrained = aReader.fConstrained;
@@ -97,7 +99,7 @@ AliFemtoEventReaderESD::AliFemtoEventReaderESD(const AliFemtoEventReaderESD &aRe
   fCurEvent = aReader.fCurEvent;
   fCurFile = aReader.fCurFile;
   fTree = aReader.fTree->CloneTree();
-  //fEvent = new AliESD(*aReader.fEvent);
+  //  fEvent = new AliESD(*aReader.fEvent);
   fEvent = new AliESD();
   fEsdFile = new TFile(aReader.fEsdFile->GetName());
   fEventFriend = aReader.fEventFriend;
@@ -124,6 +126,7 @@ AliFemtoEventReaderESD::AliFemtoEventReaderESD(const AliFemtoEventReaderESD &aRe
 //Destructor
 AliFemtoEventReaderESD::~AliFemtoEventReaderESD()
 {
+  // destructor
   //delete fListOfFiles;
   delete fTree;
   delete fEvent;
@@ -144,6 +147,7 @@ AliFemtoEventReaderESD::~AliFemtoEventReaderESD()
 //__________________
 AliFemtoEventReaderESD& AliFemtoEventReaderESD::operator=(const AliFemtoEventReaderESD& aReader)
 {
+  // assignment operator
   if (this == &aReader)
     return *this;
 
@@ -156,7 +160,6 @@ AliFemtoEventReaderESD& AliFemtoEventReaderESD::operator=(const AliFemtoEventRea
   if (fTree) delete fTree;
   fTree = aReader.fTree->CloneTree();
   if (fEvent) delete fEvent;
-  //fEvent = new AliESD(*aReader.fEvent);
   fEvent = new AliESD();
   if (fEsdFile) delete fEsdFile;
   fEsdFile = new TFile(aReader.fEsdFile->GetName());
@@ -203,15 +206,16 @@ AliFemtoEventReaderESD& AliFemtoEventReaderESD::operator=(const AliFemtoEventRea
 //__________________
 AliFemtoString AliFemtoEventReaderESD::Report()
 {
+  // create reader report
   AliFemtoString temp = "\n This is the AliFemtoEventReaderESD\n";
   return temp;
 }
 
 //__________________
-//setting the name of file where names of ESD file are written 
-//it takes only this files which have good trees
 void AliFemtoEventReaderESD::SetInputFile(const char* inputFile)
 {
+  //setting the name of file where names of ESD file are written 
+  //it takes only this files which have good trees
   char buffer[256];
   fInputFile=string(inputFile);
   cout<<"Input File set on "<<fInputFile<<endl;
@@ -263,6 +267,9 @@ bool AliFemtoEventReaderESD::GetConstrained() const
 
 AliFemtoEvent* AliFemtoEventReaderESD::ReturnHbtEvent()
 {
+  // read in a next hbt event from the chain
+  // convert it to AliFemtoEvent and return
+  // for further analysis
   AliFemtoEvent *hbtEvent = 0;
   string tFriendFileName;
 
@@ -314,7 +321,7 @@ AliFemtoEvent* AliFemtoEventReaderESD::ReturnHbtEvent()
   cout<<"starting to read event "<<fCurEvent<<endl;
   fTree->GetEvent(fCurEvent);//getting next event
   fEvent->SetESDfriend(fEventFriend);
-  vector<int> label_table;//to check labels
+  //  vector<int> tLabelTable;//to check labels
        
   hbtEvent = new AliFemtoEvent;
   //setting basic things
@@ -375,7 +382,7 @@ AliFemtoEvent* AliFemtoEventReaderESD::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
@@ -396,20 +403,20 @@ AliFemtoEvent* AliFemtoEventReaderESD::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]);
       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]);
-      if (p.mag() == 0) {
+      const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]);
+      if (ktP.mag() == 0) {
        delete trackCopy;
        continue;
       }
       const AliFmThreeVectorD origin(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(ktP,origin,(double)(fEvent->GetMagneticField())*kilogauss,(double)(trackCopy->Charge())); 
       trackCopy->SetHelix(helix);
                
       trackCopy->SetTrackId(esdtrack->GetID());
@@ -464,7 +471,7 @@ AliFemtoEvent* AliFemtoEventReaderESD::ReturnHbtEvent()
       //decision if we want this track
       //if we using diffrent labels we want that this label was use for first time 
       //if we use hidden info we want to have match between sim data and ESD
-      if (good_momentum==true)
+      if (tGoodMomentum==true)
        {
          hbtEvent->TrackCollection()->push_back(trackCopy);//adding track to analysis
          realnofTracks++;//real number of tracks